Complete.Org: Mailing Lists: Archives: freeciv-dev: November 2003:
[Freeciv-Dev] Re: (PR#6838) quashing warnings
Home

[Freeciv-Dev] Re: (PR#6838) quashing warnings

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: bh@xxxxxxxxxxxxxxxxxxx
Subject: [Freeciv-Dev] Re: (PR#6838) quashing warnings
From: "Raimar Falke" <i-freeciv-lists@xxxxxxxxxxxxx>
Date: Tue, 11 Nov 2003 23:33:41 -0800
Reply-to: rt@xxxxxxxxxxx

<URL: http://rt.freeciv.org/Ticket/Display.html?id=6838 >

On Tue, Nov 11, 2003 at 05:43:32PM -0800, Benoit Hudson wrote:
> 
> <URL: http://rt.freeciv.org/Ticket/Display.html?id=6838 >
> 
> I'm quashing some warnings.  Here's a patch to quash an unsigned/signed
> warning in common/aicore/aisupport.c.

Thanks for the spotting. This is however not signed vs unsigned but
enum vs int. If you want to continue this you may look at the attached
output of an automatic tool. It also contains the case you fixed:
common/aicore/aisupport.c: (in function player_leading_spacerace)
common/aicore/aisupport.c:36:20: Variable best_state initialized to type enum 
spaceship_state { SSHIP_NONE, SSHIP_STARTED, SSHIP_LAUNCHED, SSHIP_ARRIVED }, 
expects int: SSHIP_NONE
common/aicore/aisupport.c:52:12: Operands of > have incompatible types (enum 
spaceship_state, int): ship->state > best_state
common/aicore/aisupport.c:53:7: Assignment of enum spaceship_state to int: 
best_state = ship->state
common/aicore/aisupport.c:57:7: Assignment of enum spaceship_state to int: 
best_state = ship->state

The top functions which were called wrong are:
     10  Function dio_put_uint8 expects arg 2 to be int gets enum packet_type
     11  Function city_got_effect expects arg 2 to be Impr_Type_id gets enum 
improvement_type_id { B_AIRPORT, B_AQUEDUCT, B_BANK, ..., B_LAST_ENUM }
     11  Function get_role_unit expects arg 1 to be int gets enum unit_role_id 
{ L_FIRSTBUILD, L_EXPLORER, L_HUT, ..., L_LAST }
     13  Function best_role_unit expects arg 2 to be int gets enum unit_flag_id 
{ F_TRADE_ROUTE, F_HELP_WONDER, F_MISSILE, ..., F_LAST }
     14  Function num_role_units expects arg 1 to be int gets enum unit_role_id 
{ L_FIRSTBUILD, L_EXPLORER, L_HUT, ..., L_LAST }
     14  Function player_owns_active_wonder expects arg 2 to be Impr_Type_id 
gets enum improvement_type_id { B_AIRPORT, B_AQUEDUCT, B_BANK, ..., B_LAST_ENUM 
}
     16  Function notify_conn_ex expects arg 4 to be int gets enum event_type { 
E_NOEVENT, E_CITY_CANTBUILD, E_CITY_LOST, ..., E_LAST }
     20  Function improvement_variant expects arg 1 to be Impr_Type_id gets 
enum improvement_type_id { B_AIRPORT, B_AQUEDUCT, B_BANK, ..., B_LAST_ENUM }
     24  Function contains_special expects arg 1 to be enum tile_special_type 
gets int
     30  Function city_affected_by_wonder expects arg 2 to be Impr_Type_id gets 
enum improvement_type_id { B_AIRPORT, B_AQUEDUCT, B_BANK, ..., B_LAST_ENUM }
     39  Function dio_put_uint8 expects arg 2 to be int gets enum packet_type { 
PACKET_LOGIN_REQUEST, PACKET_LOGIN_REPLY, PACKET_PROCESSING_STARTED, ..., 
PACKET_LAST }
     40  Function unit_type_flag expects arg 2 to be int gets enum unit_flag_id 
{ F_TRADE_ROUTE, F_HELP_WONDER, F_MISSILE, ..., F_LAST }
    106  Function city_got_building expects arg 2 to be Impr_Type_id gets enum 
improvement_type_id { B_AIRPORT, B_AQUEDUCT, B_BANK, ..., B_LAST_ENUM }
    245  Function notify_player_ex expects arg 4 to be int gets enum event_type 
{ E_NOEVENT, E_CITY_CANTBUILD, E_CITY_LOST, ..., E_LAST }

Are you interrested in tackling these?

        Raimar

-- 
 email: rf13@xxxxxxxxxxxxxxxxx
 "That's fundamental game play!  My main enemy is *ALWAYS* fighting 
  a 4-front war.  I make sure of it!"
    -- Tony Stuckey, freeciv-dev

Attachment: enum-problems.gz
Description: application/gunzip


[Prev in Thread] Current Thread [Next in Thread]