thomasoa / andrews-deal

Automatically exported from code.google.com/p/andrews-deal
Other
10 stars 7 forks source link

Deal 3.1.6 compiles but does not run properly on 64-bit Ubuntu #8

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Deal compiles fine on 64-bit Ubuntu, but then it chokes actually dealing:

$ ./deal 4
          ♠ A732
          ♥ 7
          ♦ ---
          ♣ 9
 ♠ J4              ♠ A
 ♥ J4              ♥ 953
 ♦ 5432            ♦ K7
 ♣ AJT52           ♣ 963
          ♠ 65
          ♥ T82
          ♦ KQ6
          ♣ 864

....

Compiler output:

ian@Athlon4200:~/deal/deal316$ make
gcc -g -ansi -Wall -O2 -I/usr/include/tcl8.3  -c -o random.o random.c
gcc -g -ansi -Wall -O2 -I/usr/include/tcl8.3  -c -o additive.o additive.c
gcc -g -ansi -Wall -O2 -I/usr/include/tcl8.3  -c -o hand.o hand.c
hand.c: In function ‘tcl_other_hand’:
hand.c:84: warning: cast from pointer to integer of different size
hand.c: In function ‘tcl_count_suit’:
hand.c:168: warning: cast from pointer to integer of different size
hand.c: In function ‘tcl_hand_cmd’:
hand.c:220: warning: cast from pointer to integer of different size
hand.c: In function ‘HandCmd_Init’:
hand.c:523: warning: cast to pointer from integer of different size
hand.c:528: warning: cast to pointer from integer of different size
gcc -g -ansi -Wall -O2 -I/usr/include/tcl8.3  -c -o deal.o deal.c
gcc -g -ansi -Wall -O2 -I/usr/include/tcl8.3  -c -o formats.o formats.c
gcc -g -ansi -Wall -O2 -I/usr/include/tcl8.3  -c -o tcl_deal.o tcl_deal.c
tcl_deal.c: In function ‘tcl_deal_control’:
tcl_deal.c:356: warning: cast from pointer to integer of different size
gcc -g -ansi -Wall -O2 -I/usr/include/tcl8.3  -c -o maindeal.o maindeal.c
gcc -g -ansi -Wall -O2 -I/usr/include/tcl8.3  -c -o stat.o stat.c
./makecounttable > counttable.c
gcc -g -ansi -Wall -O2 -I/usr/include/tcl8.3  -c -o counttable.o counttable.c
gcc -g -ansi -Wall -O2 -I/usr/include/tcl8.3  -c -o vector.o vector.c
gcc -g -ansi -Wall -O2 -I/usr/include/tcl8.3  -c -o dist.o dist.c
dist.c: In function ‘tcl_shapeexpr_define’:
dist.c:674: warning: cast from pointer to integer of different size
gcc -g -ansi -Wall -O2 -I/usr/include/tcl8.3  -c -o stringbox.o stringbox.c
gcc -g -ansi -Wall -O2 -I/usr/include/tcl8.3  -c -o dealtypes.o dealtypes.c
dealtypes.c: In function ‘tcl_type_assert’:
dealtypes.c:319: warning: cast from pointer to integer of different size
dealtypes.c: In function ‘initializeDealTypes’:
dealtypes.c:362: warning: cast to pointer from integer of different size
dealtypes.c:364: warning: cast to pointer from integer of different size
gcc -g -ansi -Wall -O2 -I/usr/include/tcl8.3  -c -o keywords.o keywords.c
keywords.c: In function ‘Keyword_setId’:
keywords.c:88: warning: cast from pointer to integer of different size
keywords.c:90: warning: cast to pointer from integer of different size
keywords.c:95: warning: cast to pointer from integer of different size
keywords.c: In function ‘Keyword_getId’:
keywords.c:110: warning: cast from pointer to integer of different size
keywords.c: In function ‘Keyword_getKey’:
keywords.c:115: warning: cast to pointer from integer of different size
gcc -g -ansi -Wall -O2 -I/usr/include/tcl8.3  -c -o holdings.o holdings.c
gcc -g -ansi -Wall -O2 -I/usr/include/tcl8.3  -c -o tcl_dds.o tcl_dds.c
g++  -fno-rtti -g -O2  -c -o dds.o dds.cpp
g++ -g -ansi -Wall -O2 -I/usr/include/tcl8.3  random.o additive.o hand.o
deal.o formats.o tcl_deal.o maindeal.o stat.o counttable.o vector.o dist.o
stringbox.o dealtypes.o keywords.o holdings.o tcl_dds.o dds.o   -o deal
-L/usr/lib -ltcl8.3 -lm

Original issue reported on code.google.com by thomasoa on 29 Oct 2008 at 1:43

GoogleCodeExporter commented 9 years ago
The problem is that random() is returning negative numbers on 64-bit machines. 
Changed to call (unsigned)random().

Original comment by thomasoa on 29 Oct 2008 at 3:26

GoogleCodeExporter commented 9 years ago

Original comment by thomasoa on 31 Oct 2008 at 4:55