stratagus-cvs
[Top][All Lists]
Advanced

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

[Stratagus-CVS] stratagus/src ai/ai_building.c ai/ai_rules.c ai...


From: Russell Smith
Subject: [Stratagus-CVS] stratagus/src ai/ai_building.c ai/ai_rules.c ai...
Date: Fri, 24 Oct 2003 02:28:54 -0400

CVSROOT:        /cvsroot/stratagus
Module name:    stratagus
Branch:         
Changes by:     Russell Smith <address@hidden>  03/10/24 02:28:54

Modified files:
        src/ai         : ai_building.c ai_rules.c new_ai.c 
        src/clone      : ccl_helpers.c 

Log message:
        Windows compile Fixes

Patches:
Index: stratagus/src/ai/ai_building.c
diff -u stratagus/src/ai/ai_building.c:1.41 stratagus/src/ai/ai_building.c:1.42
--- stratagus/src/ai/ai_building.c:1.41 Thu Oct 23 14:38:34 2003
+++ stratagus/src/ai/ai_building.c      Fri Oct 24 02:28:54 2003
@@ -1,4 +1,4 @@
-//       _________ __                 __                               
+//       _________ __                 __
 //      /   _____//  |_____________ _/  |______     ____  __ __  ______
 //      \_____  \\   __\_  __ \__  \\   __\__  \   / ___\|  |  \/  ___/
 //      /        \|  |  |  | \// __ \|  |  / __ \_/ /_/  >  |  /\___ |
@@ -26,7 +26,7 @@
 //      Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
 //      02111-1307, USA.
 //
-//      $Id: ai_building.c,v 1.41 2003/10/23 18:38:34 n0body Exp $
+//      $Id: ai_building.c,v 1.42 2003/10/24 06:28:54 mr-russ Exp $
 
 //@{
 
@@ -64,7 +64,7 @@
 **
 **     @note           Can be faster written.
 */
-local int AiCheckSurrounding( const Unit * worker, const UnitType * type, int 
x, int y )
+local int AiCheckSurrounding(const Unit * worker, const UnitType * type, int 
x, int y)
 {
     int i;
     int h;
@@ -75,35 +75,33 @@
     --x;
     --y;
 
-    for ( i = 0; i < w; ++i ) {        // Top row
-       if ( ( x + i ) < 0 || ( x + i ) > TheMap.Width ) {      // FIXME: slow, 
worse,...
+    for (i = 0; i < w; ++i) {  // Top row
+       // FIXME: (pludov) slow, worse,...
+       if (x + i < 0 || x + i > TheMap.Width) {
            continue;
        }
-       if ( !( ( x + i ) == worker->X && y == worker->Y ) && y >= 0 &&
-            TheMap.Fields[x + i + y * TheMap.Width].Flags & ( 
MapFieldUnpassable |
-                                                              MapFieldWall | 
MapFieldRocks |
-                                                              MapFieldForest |
-                                                              MapFieldBuilding 
) ) {
+       if (!(x + i == worker->X && y == worker->Y ) && y >= 0 &&
+           TheMap.Fields[x + i + y * TheMap.Width].Flags &
+               (MapFieldUnpassable | MapFieldWall | MapFieldRocks |
+                   MapFieldForest | MapFieldBuilding)) {
            return 0;
        }                       // Bot row
-       if ( !( ( x + i ) == worker->X && ( y + h ) == worker->Y ) && ( y + h ) 
< TheMap.Height
-            && TheMap.Fields[x + i +
-                             ( y +
-                               h ) *
-                             TheMap.Width].
-            Flags & ( MapFieldUnpassable | MapFieldWall | MapFieldRocks | 
MapFieldForest |
-                      MapFieldBuilding ) ) {
+       if (!(x + i == worker->X && y + h == worker->Y ) && y + h < 
TheMap.Height &&
+           TheMap.Fields[x + i + (y + h) * TheMap.Width].Flags &
+               (MapFieldUnpassable | MapFieldWall | MapFieldRocks |
+                   MapFieldForest | MapFieldBuilding)) {
            return 0;
        }
     }
 
     ++y;
     h -= 2;
-    for ( i = 0; i < h; ++i ) {        // Left row
-       if ( ( y + i ) < 0 || ( y + i ) > TheMap.Height ) {     // FIXME: slow, 
worse,...
+    for (i = 0; i < h; ++i) {  // Left row
+       // FIXME: (pludov) slow, worse,...
+       if (y + i < 0 || y + i > TheMap.Height) {
            continue;
        }
-       if ( !( x == worker->X && ( y + i ) == worker->Y ) && x >= 0 &&
+       if (!( x == worker->X && ( y + i ) == worker->Y ) && x >= 0 &&
             TheMap.Fields[x + ( y + i ) * TheMap.Width].Flags & ( 
MapFieldUnpassable |
                                                                   MapFieldWall 
| MapFieldRocks
                                                                   | 
MapFieldForest |
Index: stratagus/src/ai/ai_rules.c
diff -u stratagus/src/ai/ai_rules.c:1.1 stratagus/src/ai/ai_rules.c:1.2
--- stratagus/src/ai/ai_rules.c:1.1     Thu Oct 23 15:15:09 2003
+++ stratagus/src/ai/ai_rules.c Fri Oct 24 02:28:54 2003
@@ -26,7 +26,7 @@
 //      Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
 //      02111-1307, USA.
 //
-//      $Id: ai_rules.c,v 1.1 2003/10/23 19:15:09 n0body Exp $
+//      $Id: ai_rules.c,v 1.2 2003/10/24 06:28:54 mr-russ Exp $
 
 //@{
 
@@ -520,18 +520,18 @@
     char buffer[256];
     char *tmp;
 
-    tmp = gh_scm2newstr( symbol, NULL );
+    tmp = gh_scm2newstr(symbol, NULL);
 
-    for ( gauge = 0; gauge < GAUGE_NB; gauge++ ) {
-       AiGetGaugeName( gauge, buffer, 256 );
+    for (gauge = 0; gauge < GAUGE_NB; ++gauge) {
+       AiGetGaugeName(gauge, buffer, 256);
 
-       if ( !strcasecmp( tmp, buffer ) ) {
-           free( tmp );
+       if (!strcmp(tmp, buffer)) {
+           free(tmp);
            return gauge;
        }
     }
-    DebugLevel3Fn( "didn't found %s\n" _C_ tmp );
-    free( tmp );
+    DebugLevel3Fn("didn't found %s\n" _C_ tmp);
+    free(tmp);
     return -1;
 }
 
Index: stratagus/src/ai/new_ai.c
diff -u stratagus/src/ai/new_ai.c:1.75 stratagus/src/ai/new_ai.c:1.76
--- stratagus/src/ai/new_ai.c:1.75      Thu Oct 23 14:38:34 2003
+++ stratagus/src/ai/new_ai.c   Fri Oct 24 02:28:54 2003
@@ -26,7 +26,7 @@
 //      Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
 //      02111-1307, USA.
 //
-//      $Id: new_ai.c,v 1.75 2003/10/23 18:38:34 n0body Exp $
+//      $Id: new_ai.c,v 1.76 2003/10/24 06:28:54 mr-russ Exp $
 
 
 //@{
@@ -704,15 +704,15 @@
 **     @param plynr    Player number.
 **     @param ai       Player AI.
 */
-local void SaveAiPlayer( CLFile * file, unsigned plynr, const PlayerAi * ai )
+local void SaveAiPlayer(CLFile* file, unsigned plynr, const PlayerAi * ai)
 {
     IOOutFile = file;
     IOLoadingMode = 0;
     IOTabLevel = 1;
 
-    CLprintf( IOOutFile, "(define-ai-player '" );
-    IOPlayerAiFullPtr( SCM_UNSPECIFIED, &ai, 0 );
-    CLprintf( IOOutFile, ")\n" );
+    CLprintf(IOOutFile, "(define-ai-player '");
+    IOPlayerAiFullPtr(SCM_UNSPECIFIED, &ai, 0);
+    CLprintf(IOOutFile, ")\n");
 }
 
 /**
@@ -740,7 +740,7 @@
 {
     CLprintf( file, "\n;;; -----------------------------------------\n" );
     CLprintf( file,
-             ";;; MODULE: AI $Id: new_ai.c,v 1.75 2003/10/23 18:38:34 n0body 
Exp $\n\n" );
+             ";;; MODULE: AI $Id: new_ai.c,v 1.76 2003/10/24 06:28:54 mr-russ 
Exp $\n\n" );
 
     SaveAiTypesWcName( file );
     SaveAiHelper( file );
Index: stratagus/src/clone/ccl_helpers.c
diff -u stratagus/src/clone/ccl_helpers.c:1.3 
stratagus/src/clone/ccl_helpers.c:1.4
--- stratagus/src/clone/ccl_helpers.c:1.3       Fri Oct 24 01:22:29 2003
+++ stratagus/src/clone/ccl_helpers.c   Fri Oct 24 02:28:54 2003
@@ -26,7 +26,7 @@
 //      Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
 //      02111-1307, USA.
 //
-//      $Id: ccl_helpers.c,v 1.3 2003/10/24 05:22:29 mr-russ Exp $
+//      $Id: ccl_helpers.c,v 1.4 2003/10/24 06:28:54 mr-russ Exp $
 
 //@{
 
@@ -184,7 +184,7 @@
 **     @param  binaryform      Pointer to the structure'reference to load/save 
( <structure-type> * )
 **     @param  para            Pointer to a CclStructDef structure, describing 
format of the structure.
 */
-local void IOStructArray(SCM from, void *binaryform, void *para)
+global void IOStructArray(SCM from, void *binaryform, void *para)
 {
     CclStructDef *def;
     int i;




reply via email to

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