Export to GitHub

andrews-deal - issue #14

Smartstack is broken on OS X


Posted on Feb 19, 2010 by Helpful Lion

Run the example 3nt stacking code:

./deal -i ex/3nt-stack.tcl

Should list hand shapes of 3nt openers.

Instead it emits the error:

Problem running smartstack: Hand stacking error
    while executing
"deck_stack_hand $info(hand) $hand"

Comment #1

Posted on Feb 19, 2010 by Helpful Lion

It's been broken since 3.1.1, at leaast.

Comment #2

Posted on Feb 23, 2010 by Helpful Lion

Okay, this bug goes all the way back to Deal 3.0.8, before I had the code in Google Code. Will have to look deeply into this.

Comment #3

Posted on Feb 23, 2010 by Helpful Lion

Works on Linux, so it might be an OS X issue.

Comment #4

Posted on Feb 23, 2010 by Helpful Lion

(No comment was entered for this change.)

Comment #5

Posted on Feb 23, 2010 by Helpful Lion

Okay, I've narrowed it down to a problem in the random number generator in random.c, which I copied from elsewhere. It is now returning negative values, which it is not supposed to do (and which it doesn't do on Linux.)

Comment #6

Posted on Feb 23, 2010 by Helpful Lion

Fixed in deal.h and tcl_deal.c by redeclaring __random() to return long rather than int type.

Comment #7

Posted on Feb 24, 2010 by Helpful Lion

(No comment was entered for this change.)

Status: Fixed

Labels:
Type-Defect Priority-High OpSys-OSX Milestone-3.1.9