stratagus-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Stratagus-CVS] stratagus ./configure.in src/clone/spells.c src...


From: Russell Smith
Subject: [Stratagus-CVS] stratagus ./configure.in src/clone/spells.c src...
Date: Wed, 24 Sep 2003 22:39:48 -0400

CVSROOT:        /cvsroot/stratagus
Module name:    stratagus
Branch:         
Changes by:     Russell Smith <address@hidden>  03/09/24 22:39:47

Modified files:
        .              : configure.in 
        src/clone      : spells.c 
        src/include    : settings.h spells.h unit.h unittype.h 
        src/unit       : unittype.c 

Log message:
        Fixed signed/unsigned comparisions
        Enabled -Wsign-compare, so they are picked up before problems arise
        Removed -fconserve-space from flags, due to issues with gcc 3.3

Patches:
Index: stratagus/configure.in
diff -u stratagus/configure.in:1.25 stratagus/configure.in:1.26
--- stratagus/configure.in:1.25 Tue Sep  2 03:07:02 2003
+++ stratagus/configure.in      Wed Sep 24 22:39:47 2003
@@ -105,9 +105,9 @@
 AC_ARG_ENABLE(debug,
     [  --enable-debug    [Enable debug, implies --disable-optimization 
(default: no)]])
 if test "$enable_debug" != "yes" -a "$enable_profile" != "yes"; then
-    DEBUG_CFLAGS="-O2 -pipe -fsigned-char -fomit-frame-pointer 
-fconserve-space -fexpensive-optimizations -ffast-math"
+    DEBUG_CFLAGS="-O2 -pipe -fsigned-char -fomit-frame-pointer 
-fexpensive-optimizations -ffast-math"
 else
-    DEBUG_CFLAGS="-g -O1 -fsigned-char -Wall -Werror -DDEBUG"
+    DEBUG_CFLAGS="-g -O1 -fsigned-char -Wsign-compare -Wall -Werror -DDEBUG"
 fi
 AC_SUBST(DEBUG_CFLAGS)
 
Index: stratagus/src/clone/spells.c
diff -u stratagus/src/clone/spells.c:1.97 stratagus/src/clone/spells.c:1.98
--- stratagus/src/clone/spells.c:1.97   Tue Sep 23 05:12:35 2003
+++ stratagus/src/clone/spells.c        Wed Sep 24 22:39:47 2003
@@ -27,7 +27,7 @@
 //      Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
 //      02111-1307, USA.
 //
-//     $Id: spells.c,v 1.97 2003/09/23 09:12:35 martinxyz Exp $
+//     $Id: spells.c,v 1.98 2003/09/25 02:39:47 mr-russ Exp $
 
 /*
 **     And when we cast our final spell
@@ -1356,7 +1356,7 @@
                                                                                
const Unit* caster,
                                                                                
const Unit* target, int x, int y)
 {
-       unsigned int    ttl;
+       int     ttl;
        assert(condition);
        ttl = condition->u.durationeffect.ttl;
 
Index: stratagus/src/include/settings.h
diff -u stratagus/src/include/settings.h:1.27 
stratagus/src/include/settings.h:1.28
--- stratagus/src/include/settings.h:1.27       Sun Aug 17 11:57:07 2003
+++ stratagus/src/include/settings.h    Wed Sep 24 22:39:47 2003
@@ -26,7 +26,7 @@
 //      Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
 //      02111-1307, USA.
 //
-//     $Id: settings.h,v 1.27 2003/08/17 15:57:07 n0body Exp $
+//     $Id: settings.h,v 1.28 2003/09/25 02:39:47 mr-russ Exp $
 
 #ifndef __SETTINGS_H__
 #define __SETTINGS_H__
@@ -78,7 +78,7 @@
     int                RevealMap;              /// Reveal map
 };
 
-#define SettingsPresetMapDefault       (~0U)   /// Special: Use pud/cm supplied
+#define SettingsPresetMapDefault       (int)(~0U)      /// Special: Use pud/cm 
supplied
 
 /*
 **     Resource-Preset factor
Index: stratagus/src/include/spells.h
diff -u stratagus/src/include/spells.h:1.21 stratagus/src/include/spells.h:1.22
--- stratagus/src/include/spells.h:1.21 Mon Sep 22 15:13:08 2003
+++ stratagus/src/include/spells.h      Wed Sep 24 22:39:47 2003
@@ -26,7 +26,7 @@
 //      Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
 //      02111-1307, USA.
 //
-//     $Id: spells.h,v 1.21 2003/09/22 19:13:08 n0body Exp $
+//     $Id: spells.h,v 1.22 2003/09/25 02:39:47 mr-russ Exp $
 
 #ifndef __SPELLS_H__
 #define __SPELLS_H__
@@ -254,7 +254,7 @@
 */
 typedef struct _spell_type_ {
     //  Identification stuff
-    unsigned int Ident;                        /// Spell numeric identifier
+    int Ident;                         /// Spell numeric identifier
     char *IdentName;                   /// Spell unique identifier 
(spell-holy-vision)
     char *Name;                                /// Spell name shown by the 
engine
 
@@ -265,6 +265,7 @@
     int Range;                         /// Max range of the target.
     unsigned int ManaCost;             /// required mana for each cast
 
+    int DependencyId;                  /// Id of upgrade, -1 if no upgrade 
needed for cast the spell.
     t_Conditions *Condition_generic;   /// Conditions to cast the spell. 
(generic (no test for each target))
     t_Conditions *Condition_specific;  /// Conditions to cast the spell. 
(target specific (ex:Hp full))
 //     Autocast        // FIXME : can use different for AI ? Use it in this 
structure ?
@@ -303,6 +304,9 @@
 
 /// done spell tables
 extern void DoneSpells(void);
+
+/// return 1 if spell is availible, 0 if not (must upgrade)
+extern int SpellIsAvailable(const Player* player, int SpellId);
 
 /// returns != 0 if spell can be casted (enough mana, valid target)
 extern int CanCastSpell(const Unit* caster, const SpellType*,
Index: stratagus/src/include/unit.h
diff -u stratagus/src/include/unit.h:1.214 stratagus/src/include/unit.h:1.215
--- stratagus/src/include/unit.h:1.214  Sun Sep 14 02:53:08 2003
+++ stratagus/src/include/unit.h        Wed Sep 24 22:39:47 2003
@@ -26,7 +26,7 @@
 //      Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
 //      02111-1307, USA.
 //
-//     $Id: unit.h,v 1.214 2003/09/14 06:53:08 mr-russ Exp $
+//     $Id: unit.h,v 1.215 2003/09/25 02:39:47 mr-russ Exp $
 
 #ifndef __UNIT_H__
 #define __UNIT_H__
@@ -432,8 +432,8 @@
 typedef struct _order_ {
     unsigned char      Action;         /// global action
     unsigned char      Flags;          /// Order flags (unused)
-    unsigned int       RangeX;         /// How near in X direction
-    unsigned int       RangeY;         /// How near in Y direction
+    int                        RangeX;         /// How near in X direction
+    int                        RangeY;         /// How near in Y direction
     unsigned int       MinRange;       /// How far away minimum
     unsigned char      IsRect:1;       /// For goal as a square, not circle
 
@@ -494,7 +494,7 @@
     
     Unit*      Next;           /// Generic link pointer (on map)
     
-    unsigned   InsideCount;            /// Number of units inside.
+    int                InsideCount;            /// Number of units inside.
     Unit*      UnitInside;             /// Pointer to one of the units inside.
     Unit*      Container;              /// Pointer to the unit containing it 
(or 0)
     Unit*      NextContained;          /// Next unit in the container.
@@ -568,7 +568,7 @@
                                        ** ,used for fancy buildings
                                        */
     unsigned   Rs : 8;
-    unsigned   CurrentResource;
+    int                CurrentResource;
 
 #define MAX_ORDERS 16                  /// How many outstanding orders?
     char       OrderCount;             /// how many orders in queue
Index: stratagus/src/include/unittype.h
diff -u stratagus/src/include/unittype.h:1.114 
stratagus/src/include/unittype.h:1.115
--- stratagus/src/include/unittype.h:1.114      Wed Sep 24 12:03:24 2003
+++ stratagus/src/include/unittype.h    Wed Sep 24 22:39:47 2003
@@ -26,7 +26,7 @@
 //      Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
 //      02111-1307, USA.
 //
-//     $Id: unittype.h,v 1.114 2003/09/24 16:03:24 n0body Exp $
+//     $Id: unittype.h,v 1.115 2003/09/25 02:39:47 mr-russ Exp $
 
 #ifndef __UNITTYPE_H__
 #define __UNITTYPE_H__
@@ -650,12 +650,12 @@
 } MissileConfig;
 
 typedef struct _resource_info_ {
-    char *     FileWhenLoaded;                 /// Change the graphic when the 
unit is loaded.
-    char *     FileWhenEmpty;                  /// Change the graphic when the 
unit is empty.
+    char*      FileWhenLoaded;                 /// Change the graphic when the 
unit is loaded.
+    char*      FileWhenEmpty;                  /// Change the graphic when the 
unit is empty.
     unsigned   HarvestFromOutside;             /// Unit harvests without 
entering the building.
     unsigned   WaitAtResource;                 /// Cycles the unit waits while 
mining.
     unsigned   ResourceStep;                   /// Resources the unit gains 
per mining cycle.
-    unsigned   ResourceCapacity;               /// Max amount of resources to 
carry.
+    int        ResourceCapacity;               /// Max amount of resources to 
carry.
     unsigned   WaitAtDepot;                    /// Cycles the unit waits while 
returning.
     unsigned   ResourceId;                     /// Id of the resource 
harvested. Redundant.
     unsigned   FinalResource;                  /// Convert resource when 
delivered. 
@@ -726,6 +726,15 @@
     int                _RegenerationRate;      /// HP regeneration HP per sec
     int                WeaponsUpgradable;      /// Weapons could be upgraded
     int                ArmorUpgradable;        /// Armor could be upgraded
+    int        DemolishRange;          /// Unit will Demolish around when dead.
+    int        DemolishDamage;         /// Damage dealt to unit affected by 
demolition.
+    int        RepairRange;            /// Units repair range.
+    char       *CanCastSpell;          /// Unit is able to use spells.
+    // FIXME: n0body: AutoBuildRate not implemented.
+    int                AutoBuildRate;          /// The rate at which the 
building builds itself
+    int        RandomMovementProbability;      /// Probability to move 
randomly.
+    int                ClicksToExplode;        /// Number of consecutive 
clicks until unit suicides.
+    int                MaxOnBoard;             /// Number of Transporter slots.
     // FIXME: original only visual effect, we do more with this!
     enum {
        UnitTypeLand,                   /// Unit lives on land
@@ -754,8 +763,6 @@
     unsigned AirUnit : 1;              /// Air animated
     unsigned SeaUnit : 1;              /// Sea animated
     unsigned ExplodeWhenKilled : 1;    /// Death explosion animated
-    unsigned int RandomMovementProbability;/// Probability to move randomly.
-    unsigned int ClicksToExplode;      /// Number of consecutive clicks until 
unit suicides.
     unsigned Sniper : 1;               /// The unit can only hit organic units.
     unsigned Wall : 1;                 /// Wall
     unsigned Building : 1;             /// Building
@@ -763,34 +770,28 @@
     unsigned DetectCloak : 1;          /// Can see Cloaked units.
     unsigned Coward : 1;               /// Unit will only attack if instructed.
     unsigned Transporter : 1;          /// Can transport units
-    unsigned MaxOnBoard;               /// Number of Transporter slots.
     unsigned Vanishes : 1;             /// Corpes & destroyed places.
     unsigned GroundAttack : 1;         /// Can do command ground attack.
     unsigned IsUndead : 1;             /// Unit is already dead.
     unsigned ShoreBuilding : 1;                /// Building must be build on 
coast.
-    char *CanCastSpell;                        /// Unit is able to use spells.
     unsigned CanAttack : 1;            /// Unit can attack.
-    unsigned int DemolishRange;                /// Unit will Demolish around 
when dead.
-    unsigned int DemolishDamage;       /// Damage dealt to unit affected by 
demolition.
-    unsigned int RepairRange;          /// Units repair range.
     unsigned BuilderOutside : 1;       /// The builder stays outside during 
the build.
     unsigned BuilderLost : 1;          /// The builder is lost after the build.
-    // FIXME: n0body: AutoBuildRate not implemented.
-    unsigned AutoBuildRate;            /// The rate at which the building 
builds itself
     unsigned Hero : 1;                 /// Is hero only used for triggers .
     unsigned Volatile : 1;             /// Invisiblity/unholy armor kills unit.
     unsigned Organic : 1;              /// Organic can be healed.
-
-    unsigned CanStore[MaxCosts];       /// Resources that we can store here.
-    unsigned GivesResource;            /// The resource this unit gives.
-    unsigned MaxWorkers;               /// Maximum number of workers.
     unsigned CanHarvest : 1;           /// Resource can be harvested.
     unsigned Harvester : 1;            /// unit is a resource harvester.
-    ResourceInfo* ResInfo[MaxCosts];   /// Resource information.
-    UnitType* MustBuildOnTop;          /// Must be built on top of something.
 
     unsigned SelectableByRectangle : 1;        /// Selectable with mouse 
rectangle.
     unsigned Teleporter : 1;           /// Can teleport other units.
+
+    int                 CanStore[MaxCosts];    /// Resources that we can store 
here.
+    int                 GivesResource;         /// The resource this unit 
gives.
+    int                 MaxWorkers;            /// Maximum number of workers.
+    ResourceInfo* ResInfo[MaxCosts];   /// Resource information.
+    UnitType* MustBuildOnTop;          /// Must be built on top of something.
+
 
     UnitSound Sound;                   /// Sounds for events
     // FIXME: temporary solution
Index: stratagus/src/unit/unittype.c
diff -u stratagus/src/unit/unittype.c:1.105 stratagus/src/unit/unittype.c:1.106
--- stratagus/src/unit/unittype.c:1.105 Wed Sep 24 12:03:24 2003
+++ stratagus/src/unit/unittype.c       Wed Sep 24 22:39:47 2003
@@ -26,7 +26,7 @@
 //      Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
 //      02111-1307, USA.
 //
-//     $Id: unittype.c,v 1.105 2003/09/24 16:03:24 n0body Exp $
+//     $Id: unittype.c,v 1.106 2003/09/25 02:39:47 mr-russ Exp $
 
 //@{
 
@@ -149,9 +149,9 @@
 {
     UnitType* type;
     UnitStats* stats;
-    unsigned player;
+    int player;
     unsigned i;
-    unsigned j;
+    int j;
 
     //
     //  Update players stats
@@ -1135,7 +1135,7 @@
     char **sp;
 
     CLprintf(file,"\n;;; -----------------------------------------\n");
-    CLprintf(file,";;; MODULE: unittypes $Id: unittype.c,v 1.105 2003/09/24 
16:03:24 n0body Exp $\n\n");
+    CLprintf(file,";;; MODULE: unittypes $Id: unittype.c,v 1.106 2003/09/25 
02:39:47 mr-russ Exp $\n\n");
 
     // Original number to internal unit-type name.
 




reply via email to

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