~ubuntu-branches/ubuntu/trusty/fruit/trusty

« back to all changes in this revision

Viewing changes to debian/patches/01-simple_go.patch

  • Committer: Bazaar Package Importer
  • Author(s): Oliver Korff
  • Date: 2011-03-28 13:32:15 UTC
  • mfrom: (2.1.4 sid)
  • Revision ID: james.westby@ubuntu.com-20110328133215-dn813u8xrlz1poem
Tags: 2.1.dfsg-5
* Remove of README.Source file
* Switch to dpkg-source 3.0 (quilt) format
* Removed the knights dependencies, because knights is not longer 
  available for updates. Removed related documentation accordingly.
* Added no stripping to the Makefile.
* New standards version: 3.9.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
Description: Fruit does not calculate a move to make because it expects the go command 
 
2
to have arguments, e.g. 'go wtime 30000'. This is because it looks for a string starting 
 
3
with "go " instead of just "go". If that change is made it appears to just do an infinite 
 
4
search. I've attached a patch that allows the simple go command and searches to depth 5 
 
5
if no arguments are passed to go.
 
6
Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/fruit/+bug/74764
 
7
Author: Robert Ancell, robert.ancell@canonical.com
 
8
 
 
9
 
 
10
Index: fruit-2.1.dfsg-1.orig/src/protocol.cpp
 
11
===================================================================
 
12
--- fruit-2.1.dfsg-1.orig.orig/src/protocol.cpp 2010-12-09 12:34:30.000000000 +0100
 
13
+++ fruit-2.1.dfsg-1.orig/src/protocol.cpp      2010-12-13 09:49:11.000000000 +0100
 
14
@@ -129,7 +129,7 @@
 
15
 
 
16
       // dummy
 
17
 
 
18
-   } else if (string_start_with(string,"go ")) {
 
19
+   } else if (string_start_with(string,"go")) {
 
20
 
 
21
       if (!Searching && !Delay) {
 
22
          init();
 
23
@@ -230,7 +230,7 @@
 
24
 
 
25
    const char * ptr;
 
26
    bool infinite, ponder;
 
27
-   int depth, mate, movestogo;
 
28
+   int depth, mate, movestogo, arg_count;
 
29
    sint64 nodes;
 
30
    double binc, btime, movetime, winc, wtime;
 
31
    double time, inc;
 
32
@@ -257,7 +257,10 @@
 
33
 
 
34
    ptr = strtok(string," "); // skip "go"
 
35
 
 
36
+   arg_count = 0;
 
37
    for (ptr = strtok(NULL," "); ptr != NULL; ptr = strtok(NULL," ")) {
 
38
+       arg_count++;
 
39
+
 
40
 
 
41
       if (false) {
 
42
 
 
43
@@ -344,9 +347,16 @@
 
44
 
 
45
          wtime = double(atoi(ptr)) / 1000.0;
 
46
          ASSERT(wtime>=0.0);
 
47
-      }
 
48
+      } else 
 
49
+       arg_count--;
 
50
    }
 
51
 
 
52
+    
 
53
+    // If no arguments default to search depth 5
 
54
+    if (arg_count == 0)
 
55
+       depth = 5;
 
56
+
 
57
+
 
58
    // init
 
59
 
 
60
    search_clear();