[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Stratagus-CVS] stratagus/src ai/ai_resource.c ai/ccl_ai.c ai/n...
From: |
Crestez Leonard |
Subject: |
[Stratagus-CVS] stratagus/src ai/ai_resource.c ai/ccl_ai.c ai/n... |
Date: |
Tue, 28 Oct 2003 17:41:14 -0500 |
CVSROOT: /cvsroot/stratagus
Module name: stratagus
Branch:
Changes by: Crestez Leonard <address@hidden> 03/10/28 17:41:14
Modified files:
src/ai : ai_resource.c ccl_ai.c new_ai.c
src/clone : mpq.c scm.c
src/include : stratagus.h
Log message:
Riped out the dreaded IfDebug.
Patches:
Index: stratagus/src/ai/ai_resource.c
diff -u stratagus/src/ai/ai_resource.c:1.73 stratagus/src/ai/ai_resource.c:1.74
--- stratagus/src/ai/ai_resource.c:1.73 Sun Oct 26 10:34:58 2003
+++ stratagus/src/ai/ai_resource.c Tue Oct 28 17:41:12 2003
@@ -26,7 +26,7 @@
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
// 02111-1307, USA.
//
-// $Id: ai_resource.c,v 1.73 2003/10/26 15:34:58 pludov Exp $
+// $Id: ai_resource.c,v 1.74 2003/10/28 22:41:12 n0body Exp $
//@{
@@ -262,8 +262,9 @@
DebugLevel3Fn("%s can made %s\n" _C_ type->Ident _C_ building->Ident);
- IfDebug(unit = NoUnitP;
- );
+#ifdef DEBUG
+ unit = NoUnitP;
+#endif
//
// Remove all workers on the way building something
//
@@ -375,8 +376,10 @@
DebugLevel3Fn("%s can made %s\n" _C_ type->Ident _C_ what->Ident);
- IfDebug(unit = NoUnitP;
- );
+#ifdef DEBUG
+ unit = NoUnitP;
+#endif
+
//
// Remove all units already doing something.
//
@@ -531,9 +534,9 @@
DebugLevel3Fn("%s can research %s\n" _C_ type->Ident _C_ what->Ident);
- IfDebug(unit = NoUnitP;
- );
- //
+#ifdef DEBUG
+ unit = NoUnitP;
+#endif
// Remove all units already doing something.
//
nunits = FindPlayerUnitsByType(AiPlayer->Player, type, table);
@@ -626,9 +629,9 @@
DebugLevel3Fn("%s can upgrade-to %s\n" _C_ type->Ident _C_ what->Ident);
- IfDebug(unit = NoUnitP;
- );
- //
+#ifdef DEBUG
+ unit = NoUnitP;
+#endif
// Remove all units already doing something.
//
nunits = FindPlayerUnitsByType(AiPlayer->Player, type, table);
@@ -1053,8 +1056,9 @@
DebugLevel3Fn("%s can repair %s\n" _C_ type->Ident _C_
building->Type->Ident);
- IfDebug(unit = NoUnitP;
- );
+#ifdef DEBUG
+ unit = NoUnitP;
+#endif
//
// Remove all workers not mining. on the way building something
// FIXME: It is not clever to use workers with gold
Index: stratagus/src/ai/ccl_ai.c
diff -u stratagus/src/ai/ccl_ai.c:1.72 stratagus/src/ai/ccl_ai.c:1.73
--- stratagus/src/ai/ccl_ai.c:1.72 Sun Oct 26 10:34:59 2003
+++ stratagus/src/ai/ccl_ai.c Tue Oct 28 17:41:13 2003
@@ -26,7 +26,7 @@
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
// 02111-1307, USA.
//
-// $Id: ccl_ai.c,v 1.72 2003/10/26 15:34:59 pludov Exp $
+// $Id: ccl_ai.c,v 1.73 2003/10/28 22:41:13 n0body Exp $
//@{
@@ -562,11 +562,12 @@
UnitType *type;
Upgrade *upgrade;
int cost;
-
- IfDebug(type = NULL;
- upgrade = NULL;
- cost = 0;
- ); // keep the compiler happy
+
+#ifdef DEBUG
+ type = NULL;
+ upgrade = NULL;
+ cost = 0;
+#endif
while (!gh_null_p(list)) {
sub_list = gh_car(list);
list = gh_cdr(list);
Index: stratagus/src/ai/new_ai.c
diff -u stratagus/src/ai/new_ai.c:1.79 stratagus/src/ai/new_ai.c:1.80
--- stratagus/src/ai/new_ai.c:1.79 Sun Oct 26 13:40:05 2003
+++ stratagus/src/ai/new_ai.c Tue Oct 28 17:41:13 2003
@@ -26,7 +26,7 @@
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
// 02111-1307, USA.
//
-// $Id: new_ai.c,v 1.79 2003/10/26 18:40:05 jsalmon3 Exp $
+// $Id: new_ai.c,v 1.80 2003/10/28 22:41:13 n0body Exp $
//@{
@@ -744,7 +744,7 @@
{
CLprintf(file, "\n;;; -----------------------------------------\n");
CLprintf(file,
- ";;; MODULE: AI $Id: new_ai.c,v 1.79 2003/10/26 18:40:05 jsalmon3 Exp
$\n\n");
+ ";;; MODULE: AI $Id: new_ai.c,v 1.80 2003/10/28 22:41:13 n0body Exp
$\n\n");
SaveAiTypesWcName(file);
SaveAiHelper(file);
@@ -1347,7 +1347,11 @@
DebugLevel3Fn("%d:\n" _C_ player->Player);
AiPlayer = player->Ai;
- IfDebug(if (!AiPlayer) return;); // For debug only!
+#ifdef DEBUG
+ if (!AiPlayer) {
+ return;
+ }
+#endif
//
// Advance script
Index: stratagus/src/clone/mpq.c
diff -u stratagus/src/clone/mpq.c:1.15 stratagus/src/clone/mpq.c:1.16
--- stratagus/src/clone/mpq.c:1.15 Fri Jul 11 10:35:30 2003
+++ stratagus/src/clone/mpq.c Tue Oct 28 17:41:13 2003
@@ -26,7 +26,7 @@
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
// 02111-1307, USA.
//
-// $Id: mpq.c,v 1.15 2003/07/11 14:35:30 n0body Exp $
+// $Id: mpq.c,v 1.16 2003/10/28 22:41:13 n0body Exp $
//@{
@@ -1267,7 +1267,10 @@
UInt32 var4,var8,varc,var10,var14;
UInt32 flag,tmp0,tmp1,tmp2,tmp3,tmp4,tmp5;
- IfDebug( var14=0; ); // Disable warning! Correct?
+#ifdef DEBUG
+ var14=0; // Disable warning! Correct?
+#endif
+
var4=0;
if(size_out==0) {
return 0;
Index: stratagus/src/clone/scm.c
diff -u stratagus/src/clone/scm.c:1.25 stratagus/src/clone/scm.c:1.26
--- stratagus/src/clone/scm.c:1.25 Tue Jul 22 10:32:21 2003
+++ stratagus/src/clone/scm.c Tue Oct 28 17:41:14 2003
@@ -26,7 +26,7 @@
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
// 02111-1307, USA.
//
-// $Id: scm.c,v 1.25 2003/07/22 14:32:21 n0body Exp $
+// $Id: scm.c,v 1.26 2003/10/28 22:41:14 n0body Exp $
//@{
@@ -1346,12 +1346,12 @@
sprintf(buf,"%d",n);
unit=(char**)hash_find(TheMap.Tileset->ItemsHash,buf);
- IfDebug(
- if( !unit ) {
- fprintf(stderr,"THG2 n=%d (%d,%d)\n",n,x,y);
- continue;
- }
- );
+#ifdef DEBUG
+ if( !unit ) {
+ fprintf(stderr,"THG2 n=%d (%d,%d)\n",n,x,y);
+ continue;
+ }
+#endif
// FIXME: remove
type = UnitTypeByIdent(*unit);
Index: stratagus/src/include/stratagus.h
diff -u stratagus/src/include/stratagus.h:1.23
stratagus/src/include/stratagus.h:1.24
--- stratagus/src/include/stratagus.h:1.23 Fri Oct 24 23:12:16 2003
+++ stratagus/src/include/stratagus.h Tue Oct 28 17:41:14 2003
@@ -26,7 +26,7 @@
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
// 02111-1307, USA.
//
-// $Id: stratagus.h,v 1.23 2003/10/25 03:12:16 n0body Exp $
+// $Id: stratagus.h,v 1.24 2003/10/28 22:41:14 n0body Exp $
#ifndef __STRATAGUS_H__
#define __STRATAGUS_H__
@@ -183,11 +183,6 @@
#ifdef DEBUG // {
/**
- ** Include code only if debugging.
- */
-#define IfDebug(code) code
-
- /**
** Debug check condition. If cond is true abort with file,line.
*/
#define DebugCheck(cond) do{ if( cond ) { \
@@ -244,7 +239,6 @@
#else // }{ DEBUG
-#define IfDebug(code) /* disabled */
#define DebugCheck(cond) /* disabled */
#define DebugLevel0(args) /* disabled */
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Stratagus-CVS] stratagus/src ai/ai_resource.c ai/ccl_ai.c ai/n...,
Crestez Leonard <=