~ubuntu-branches/debian/sid/gnome-chess/sid

« back to all changes in this revision

Viewing changes to debian/patches/013-engine-pgn-fixes.diff

  • Committer: Bazaar Package Importer
  • Author(s): Sebastian Rittau
  • Date: 2005-09-04 18:16:43 UTC
  • mfrom: (2.1.1 warty)
  • Revision ID: james.westby@ubuntu.com-20050904181643-qfph33u3pa4azz5h
Tags: 0.3.3-6
* Fix problems with gcc 4.0:
  + debian/patches/021-gcc-4.0-fixes.diff: New patch.
  + Closes: #258798 "FTBFS with gcc-3.4: label at end of compound statement"
* Fix wrong Debian patch:
  + debian/patch/019-assertions.diff: Fixed.
  + Partly addresses bug #247846 "Crashes after a few moves (assertion
    failed)". This fix is not perfect. As Göran Weinholt notes in the
    bug report, assertions are not the way to go, but are a temporary
    stop-gap measure. (Better assertions than unpredicable results.)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
--- src/engine-pgn.c.old        2001-07-16 22:46:36.000000000 +0200
 
2
+++ src/engine-pgn.c    2003-06-12 02:56:21.000000000 +0200
 
3
@@ -134,7 +134,7 @@
 
4
 
 
5
 
 
6
 GtkObject *
 
7
-engine_pgn_new (char *filename)
 
8
+engine_pgn_new (const char *filename)
 
9
 {
 
10
        EnginePgn *engine;
 
11
        EnginePgnPrivate *priv;
 
12
@@ -145,16 +145,18 @@
 
13
        
 
14
        priv->pgn_info = pgn_open (filename);
 
15
 
 
16
-       for (l = priv->pgn_info->game_tags; l != NULL; l = l->next) {
 
17
-               Pgn_Tag *tag = l->data;
 
18
-               char *text[3] = { "", "","" };
 
19
-               gint row;
 
20
+       if (priv->pgn_info) {
 
21
+               for (l = priv->pgn_info->game_tags; l != NULL; l = l->next) {
 
22
+                       Pgn_Tag *tag = l->data;
 
23
+                       char *text[3] = { "", "","" };
 
24
+                       gint row;
 
25
                
 
26
-               row = gtk_clist_append (GTK_CLIST (priv->games), text);
 
27
-               gtk_clist_set_row_data(GTK_CLIST (priv->games), row, (gpointer)row);
 
28
-               gtk_clist_set_text (GTK_CLIST (priv->games), row , 0, tag->white);
 
29
-               gtk_clist_set_text (GTK_CLIST (priv->games), row , 1, tag->black);
 
30
-               gtk_clist_set_text (GTK_CLIST (priv->games), row , 2, tag->result);
 
31
+                       row = gtk_clist_append (GTK_CLIST (priv->games), text);
 
32
+                       gtk_clist_set_row_data(GTK_CLIST (priv->games), row, (gpointer)row);
 
33
+                       gtk_clist_set_text (GTK_CLIST (priv->games), row , 0, tag->white);
 
34
+                       gtk_clist_set_text (GTK_CLIST (priv->games), row , 1, tag->black);
 
35
+                       gtk_clist_set_text (GTK_CLIST (priv->games), row , 2, tag->result);
 
36
+               }
 
37
        }
 
38
        board_window_add_info (main_board_window, g_basename (filename), priv->sw);
 
39
 
 
40
@@ -227,7 +229,7 @@
 
41
        EnginePgn *engine = data;
 
42
 
 
43
        priv = engine->priv;
 
44
-       dialog_pgn(priv->tag);
 
45
+       priv->tag = dialog_pgn(priv->tag);
 
46
 }
 
47
 
 
48
 static void 
 
49
--- src/engine-pgn.h.old        2001-04-24 20:35:09.000000000 +0200
 
50
+++ src/engine-pgn.h    2003-06-12 02:57:38.000000000 +0200
 
51
@@ -55,7 +55,7 @@
 
52
 
 
53
 
 
54
 GtkType    engine_pgn_get_type (void);
 
55
-GtkObject *engine_pgn_new      (char *filename);
 
56
+GtkObject *engine_pgn_new      (const char *filename);
 
57
 
 
58
 #ifdef __cplusplus
 
59
 }