heroes-commits
[Top][All Lists]
Advanced

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

[Heroes] heroes ./ChangeLog doc/heroes.texi src/argv.c s...


From: Alexandre Duret-Lutz
Subject: [Heroes] heroes ./ChangeLog doc/heroes.texi src/argv.c s...
Date: Sun, 24 Nov 2002 16:15:01 -0500

CVSROOT:        /cvsroot/heroes
Module name:    heroes
Changes by:     Alexandre Duret-Lutz <address@hidden>   02/11/24 16:15:01

Modified files:
        .              : ChangeLog 
        doc            : heroes.texi 
        src            : argv.c camera.c camera.h const.c const.h 
                         gameid.c gameid.h heroes.c scores.c scores.h 
                         system.h 

Log message:
        * src/argv.c (list): Take a const string as argument.
        * src/camera.h (coerner): Strip useless parentheses in declaration.
        * src/camera.c (coerner): Likewise.
        * src/const.h (render_buffer): Likewise.
        * src/const.c (render_buffer): Likewise.
        * src/gameid.h (gameid_ptr): Rename as ...
        (a_gameid_ptr): ... this.
        (create_gameid, empty_gameid, equal_gameid, copy_gameid,
        gameid_to_text, text_to_gameid): Adjust to use a_gameid_ptr.
        * src/gameid.c (create_gameid, empty_gameid, equal_gameid,
        copy_gameid, gameid_to_text, text_to_gameid): Likewise.
        * src/scores.h (find_score_by_gameid, insert_scores): Likewise.
        * src/scores.c (find_score_by_gameid, insert_scores): Likewise.
        * src/heroes.c (mouse_found): Suppress, always 1 and used once.
        (load_level): Return an int.
        (main_menu): Don't use mouse_found.
        * src/system.c [S_SPLINT_S] (bool, false, true): Define for Splint.

Patches:
Index: heroes/ChangeLog
diff -u heroes/ChangeLog:1.805 heroes/ChangeLog:1.806
--- heroes/ChangeLog:1.805      Sun Nov 24 16:02:26 2002
+++ heroes/ChangeLog    Sun Nov 24 16:15:00 2002
@@ -1,5 +1,25 @@
 2002-11-24  Alexandre Duret-Lutz  <address@hidden>
 
+       * src/argv.c (list): Take a const string as argument.
+       * src/camera.h (coerner): Strip useless parentheses in declaration.
+       * src/camera.c (coerner): Likewise.
+       * src/const.h (render_buffer): Likewise.
+       * src/const.c (render_buffer): Likewise.
+       * src/gameid.h (gameid_ptr): Rename as ...
+       (a_gameid_ptr): ... this.
+       (create_gameid, empty_gameid, equal_gameid, copy_gameid,
+       gameid_to_text, text_to_gameid): Adjust to use a_gameid_ptr.
+       * src/gameid.c (create_gameid, empty_gameid, equal_gameid,
+       copy_gameid, gameid_to_text, text_to_gameid): Likewise.
+       * src/scores.h (find_score_by_gameid, insert_scores): Likewise.
+       * src/scores.c (find_score_by_gameid, insert_scores): Likewise.
+       * src/heroes.c (mouse_found): Suppress, always 1 and used once.
+       (load_level): Return an int.
+       (main_menu): Don't use mouse_found.
+       * src/system.c [S_SPLINT_S] (bool, false, true): Define for Splint.
+
+2002-11-24  Alexandre Duret-Lutz  <address@hidden>
+
        * m4/gccwarn.m4 (CF_GCC_WARNINGS): Remove -Wredundant-decls.  This
        gives warnings in glibc's headers with GCC 2.95.
        * m4/getoptlong.m4: Use AC_CHECK_HEADERS instead of AC_CHECK_HEADER,
Index: heroes/doc/heroes.texi
diff -u heroes/doc/heroes.texi:1.96 heroes/doc/heroes.texi:1.97
--- heroes/doc/heroes.texi:1.96 Sun Nov 17 12:35:27 2002
+++ heroes/doc/heroes.texi      Sun Nov 24 16:15:00 2002
@@ -490,9 +490,9 @@
 @unnumberedsubsec Packagers
 @itemize @bullet
 @item
address@hidden@@brown.edu,Daniel Burrows} (Debian GNU/Linux)
address@hidden@@debian.org,Daniel Burrows} (Debian GNU/Linux)
 @item
address@hidden@@ensicaen.ismra.fr,Jean Delvare} (RPM & Slackware Linux)
address@hidden@@linux-fr.org,Jean Delvare} (RPM & Slackware Linux)
 @item
 @email{eloli@@hotmail.com,Eugenia Loli-Queru} (BeOS)
 @item
@@ -1265,11 +1265,11 @@
 
 @table @samp
 @item SECTION
-The different parts of the game (introduction,
+The different parts of the game (introduction, 
 demonstration, menus, ...).
 
 @item SYSTEM
-Handling of environment variables, creation of
+Handling of environment variables, creation of 
 directories, initialization of libraries.
 
 @item RESOURCE
Index: heroes/src/argv.c
diff -u heroes/src/argv.c:1.43 heroes/src/argv.c:1.44
--- heroes/src/argv.c:1.43      Tue Mar  5 17:47:03 2002
+++ heroes/src/argv.c   Sun Nov 24 16:15:00 2002
@@ -69,7 +69,7 @@
 /* Return true if the game can exit on return, or false if some action
    has been postponed.  */
 static bool
-list (char *word)
+list (const char *word)
 {
   if (!word) {
     puts (_("Use `-lWORD' or `--list=WORD' where WORD can be:"));
@@ -87,31 +87,31 @@
            _("print the sound track list"));
     return true;
   }
-  if (!strcasecmp (word,"resources") ||
-      !strcasecmp (word,"rsc")) {
+  if (!strcasecmp (word, "resources") ||
+      !strcasecmp (word, "rsc")) {
     print_rsc_files ();
-  } else if (!strcasecmp (word,"levels") ||
-            !strcasecmp (word,"lvl")) {
+  } else if (!strcasecmp (word, "levels") ||
+            !strcasecmp (word, "lvl")) {
     showlevels = true;
     return false;
-  } else if (!strcasecmp (word,"sound-drivers") ||
-            !strcasecmp (word,"sd")) {
+  } else if (!strcasecmp (word, "sound-drivers") ||
+            !strcasecmp (word, "sd")) {
     print_drivers_list ();
-  } else if (!strcasecmp (word,"debug") ||
-            !strcasecmp (word,"channels")) {
+  } else if (!strcasecmp (word, "debug") ||
+            !strcasecmp (word, "channels")) {
     print_debug_channels ();
-  } else if (!strcasecmp (word,"sound-tracks") ||
-            !strcasecmp (word,"st")) {
+  } else if (!strcasecmp (word, "sound-tracks") ||
+            !strcasecmp (word, "st")) {
     print_sound_track_list ();
-  } else if (!strcasecmp (word,"preferences") ||
-            !strcasecmp (word,"prefs")) {
+  } else if (!strcasecmp (word, "preferences") ||
+            !strcasecmp (word, "prefs")) {
     showprefs = true;
     return false;
-  } else if (!strcasecmp (word,"sound-tracks-stat") || /* undocumented */
-            !strcasecmp (word,"sts")) {
+  } else if (!strcasecmp (word, "sound-tracks-stat") || /* undocumented */
+            !strcasecmp (word, "sts")) {
     print_sound_track_list_stat ();
-  } else if (!strcasecmp (word,"variables") || /* undocumented yet */
-            !strcasecmp (word,"vars")) {
+  } else if (!strcasecmp (word, "variables") || /* undocumented yet */
+            !strcasecmp (word, "vars")) {
     var_print_all ();
   } else {
     /* Unknown WORD, print usage. */
Index: heroes/src/camera.c
diff -u heroes/src/camera.c:1.9 heroes/src/camera.c:1.10
--- heroes/src/camera.c:1.9     Mon Apr  1 10:06:32 2002
+++ heroes/src/camera.c Sun Nov 24 16:15:00 2002
@@ -28,7 +28,7 @@
                                      used for intertia.  */
 unsigned int corner_x[2];
 unsigned int corner_y[2];
-a_pixel *(corner[2]);
+a_pixel *corner[2];
 
 unsigned int corner_dx[2];
 unsigned int corner_dy[2];
Index: heroes/src/camera.h
diff -u heroes/src/camera.h:1.4 heroes/src/camera.h:1.5
--- heroes/src/camera.h:1.4     Fri Sep 21 06:43:54 2001
+++ heroes/src/camera.h Sun Nov 24 16:15:00 2002
@@ -25,7 +25,7 @@
 
 extern unsigned int corner_x[2]; /* in pixels */
 extern unsigned int corner_y[2]; /* idem */
-extern a_pixel *(corner[2]);   /* topleft of the camera vision */
+extern a_pixel *corner[2];     /* topleft of the camera vision */
 
 extern unsigned int corner_dx[2]; /* coordinate of the first tile */
 extern unsigned int corner_dy[2]; /* idem */
Index: heroes/src/const.c
diff -u heroes/src/const.c:1.51 heroes/src/const.c:1.52
--- heroes/src/const.c:1.51     Sun Jun 16 15:49:00 2002
+++ heroes/src/const.c  Sun Nov 24 16:15:00 2002
@@ -45,7 +45,7 @@
 /* int error; */
 char in_jokebox;
 
-a_pixel *(render_buffer[2]);           /* xbuf * ybuf */
+a_pixel *render_buffer[2];             /* xbuf * ybuf */
 
 a_pixel glenz[8][256];         /* glenz lines */
 
Index: heroes/src/const.h
diff -u heroes/src/const.h:1.41 heroes/src/const.h:1.42
--- heroes/src/const.h:1.41     Sun Jun 16 15:15:34 2002
+++ heroes/src/const.h  Sun Nov 24 16:15:00 2002
@@ -32,7 +32,7 @@
 
 extern int rounds_nbr_values[16];
 
-extern a_pixel *(render_buffer[2]);    /* xbuf * ybuf */
+extern a_pixel *render_buffer[2];      /* xbuf * ybuf */
 
 char key_or_joy_ready (void);
 a_keycode get_key_or_joy (void);
Index: heroes/src/gameid.c
diff -u heroes/src/gameid.c:1.3 heroes/src/gameid.c:1.4
--- heroes/src/gameid.c:1.3     Fri Sep 21 06:43:54 2001
+++ heroes/src/gameid.c Sun Nov 24 16:15:00 2002
@@ -22,7 +22,7 @@
 #include "gameid.h"
 
 void
-create_gameid (gameid_ptr gid)
+create_gameid (a_gameid_ptr gid)
 {
   int i;
   for (i = 0; i < GAMEID_SIZE; ++i)
@@ -30,7 +30,7 @@
 }
 
 void
-empty_gameid (gameid_ptr gid)
+empty_gameid (a_gameid_ptr gid)
 {
   int i;
   for (i = 0; i < GAMEID_SIZE; ++i)
@@ -38,7 +38,7 @@
 }
 
 bool
-equal_gameid (const gameid_ptr gid1, const gameid_ptr gid2)
+equal_gameid (const a_gameid_ptr gid1, const a_gameid_ptr gid2)
 {
   int i;
   for (i = 0; i < GAMEID_SIZE; ++i)
@@ -48,7 +48,7 @@
 }
 
 void
-copy_gameid (gameid_ptr gid1, const gameid_ptr gid2)
+copy_gameid (a_gameid_ptr gid1, const a_gameid_ptr gid2)
 {
   int i;
   for (i = 0; i < GAMEID_SIZE; ++i)
@@ -56,7 +56,7 @@
 }
 
 char *
-gameid_to_text (const gameid_ptr gid)
+gameid_to_text (const a_gameid_ptr gid)
 {
   int i;
   char *result;
@@ -69,7 +69,7 @@
 }
 
 bool
-text_to_gameid (const char *src, gameid_ptr gid)
+text_to_gameid (const char *src, a_gameid_ptr gid)
 {
   int i;
   int j;
Index: heroes/src/gameid.h
diff -u heroes/src/gameid.h:1.3 heroes/src/gameid.h:1.4
--- heroes/src/gameid.h:1.3     Fri Sep 21 06:43:54 2001
+++ heroes/src/gameid.h Sun Nov 24 16:15:00 2002
@@ -49,16 +49,16 @@
 
 #define GAMEID_SIZE 4
 typedef a_u32 a_gameid[GAMEID_SIZE];
-typedef a_u32 *gameid_ptr;
+typedef a_u32 *a_gameid_ptr;
 
-void create_gameid (gameid_ptr gid);
-void empty_gameid (gameid_ptr gid);
-bool equal_gameid (const gameid_ptr gid1, const gameid_ptr gid2);
-void copy_gameid (gameid_ptr gid1, const gameid_ptr gid2);
+void create_gameid (a_gameid_ptr gid);
+void empty_gameid (a_gameid_ptr gid);
+bool equal_gameid (const a_gameid_ptr gid1, const a_gameid_ptr gid2);
+void copy_gameid (a_gameid_ptr gid1, const a_gameid_ptr gid2);
 
-char *gameid_to_text (const gameid_ptr gid);
+char *gameid_to_text (const a_gameid_ptr gid);
 
 /* Return true on error.  */
-bool text_to_gameid (const char *src, gameid_ptr gid);
+bool text_to_gameid (const char *src, a_gameid_ptr gid);
 
 #endif /* HEROES_GAMEID_H */
Index: heroes/src/heroes.c
diff -u heroes/src/heroes.c:1.172 heroes/src/heroes.c:1.173
--- heroes/src/heroes.c:1.172   Sun Jun 16 15:15:34 2002
+++ heroes/src/heroes.c Sun Nov 24 16:15:00 2002
@@ -87,8 +87,6 @@
 #define DEMO_DURATION 90
 
 char enable_blit;
-
-char mouse_found = 1;
 /***********************/
 
 char txt_tmp[20];
@@ -127,7 +125,7 @@
   free (render_buffer[1]);
 }
 
-static char
+static int
 load_level (char *filename, char cont)
 {
   int err;
@@ -958,10 +956,8 @@
       jukebox_menu ();
     if (l == 4)
       scores_menu ();
-    if (l == 5) {
-      if (mouse_found)
-       editor_first_menu ();
-    }
+    if (l == 5)
+      editor_first_menu ();
     if (l == 6)
       flag = quit_menu ();
   } while (flag == 0);
Index: heroes/src/scores.c
diff -u heroes/src/scores.c:1.27 heroes/src/scores.c:1.28
--- heroes/src/scores.c:1.27    Fri Sep 21 06:43:55 2001
+++ heroes/src/scores.c Sun Nov 24 16:15:00 2002
@@ -73,7 +73,7 @@
 }
 
 int
-find_score_by_gameid (gameid_ptr gid)
+find_score_by_gameid (a_gameid_ptr gid)
 {
   int i;
   for (i = 0; i < 10; i++)
@@ -233,7 +233,7 @@
    the score would have been inserted or not (if it's too low).  */
 bool
 insert_scores (int gamemode, const char *player_name,
-              a_gameid gid, a_u32 points)
+              a_gameid_ptr gid, a_u32 points)
 {
   int mag = find_score_by_gameid (gid);
   /* If we are not goiing to override the score for an existing game,
Index: heroes/src/scores.h
diff -u heroes/src/scores.h:1.12 heroes/src/scores.h:1.13
--- heroes/src/scores.h:1.12    Fri Sep 21 06:43:55 2001
+++ heroes/src/scores.h Sun Nov 24 16:15:01 2002
@@ -41,10 +41,10 @@
 void write_scores (void);
 void write_scores_locked (void);
 bool insert_scores (int gamemode, const char *player_name,
-                   a_gameid gid, a_u32 points);
+                   a_gameid_ptr gid, a_u32 points);
 void load_scores (void);
 void load_scores_and_keep_locked (void);
 void free_scores (void);
-int find_score_by_gameid (gameid_ptr gid);
+int find_score_by_gameid (a_gameid_ptr gid);
 
 #endif /* HEROES__SCORES__H */
Index: heroes/src/system.h
diff -u heroes/src/system.h:1.34 heroes/src/system.h:1.35
--- heroes/src/system.h:1.34    Tue Mar 19 14:12:59 2002
+++ heroes/src/system.h Sun Nov 24 16:15:01 2002
@@ -195,11 +195,17 @@
 
 /* boolean type */
 
-#if HAVE_STDBOOL_H
-# include <stdbool.h>
-#else
+#if S_SPLINT_S
+# define bool lltX_bool
+# define false FALSE
+# define true TRUE
+#else /* ! S_SPLINT_S */
+# if HAVE_STDBOOL_H && !S_SPLINT_S
+#  include <stdbool.h>
+# else
 typedef enum {false = 0, true = 1} bool;
-#endif
+# endif
+#endif /* ! S_SPLINT_S */
 
 #ifndef M_PI
 # define M_PI  3.14159265358979323846  /* pi */




reply via email to

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