1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-12-28 05:29:48 +00:00

[patch] Unbreak port: games/CaribbeanStud

Port build now with both gcc 2.95.4 and 3.3.1. It also
	respects CFLAGS, which it didn't before.

PR:		ports/55733
Submitted by:	Simon Barner <barner@in.tum.de>
This commit is contained in:
Edwin Groothuis 2003-09-28 11:49:27 +00:00
parent 44c28c4e1c
commit baf470f2da
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=89654
12 changed files with 317 additions and 16 deletions

View File

@ -18,7 +18,7 @@ COMMENT= Caribbean Stud gambling game for X Window System
MAKEFILE= Xmakefile MAKEFILE= Xmakefile
USE_MOTIF= yes USE_MOTIF= yes
USE_X_PREFIX= yes USE_X_PREFIX= yes
CFLAGS= -pedantic CFLAGS+= -Wno-deprecated
do-install: do-install:
@ ${INSTALL_PROGRAM} ${WRKSRC}/CaribbeanStud ${PREFIX}/bin @ ${INSTALL_PROGRAM} ${WRKSRC}/CaribbeanStud ${PREFIX}/bin

View File

@ -0,0 +1,20 @@
--- Card.h.orig Tue Aug 19 11:57:32 2003
+++ Card.h Tue Aug 19 11:58:21 2003
@@ -59,7 +59,7 @@
// Class Card
-inline Card::operator==(const Card &right) const
+inline int Card::operator==(const Card &right) const
{
return ( _suit == right._suit &&
(_rank == right._rank ||
@@ -69,7 +69,7 @@
);
}
-inline Card::operator!=(const Card &right) const
+inline int Card::operator!=(const Card &right) const
{
return !( operator == (right) );
}

View File

@ -0,0 +1,12 @@
--- Dealer.cpp.orig Tue Aug 19 12:01:24 2003
+++ Dealer.cpp Tue Aug 19 12:02:07 2003
@@ -141,7 +141,8 @@
void Dealer::NewGame()
{
- for(int i=0; _players[i]; i++)
+ int i;
+ for(i=0; _players[i]; i++)
_players[i]->NewGame();
Hands::NewGame();

View File

@ -0,0 +1,23 @@
--- Dealer.h.orig Tue Aug 19 11:59:05 2003
+++ Dealer.h Tue Aug 19 12:00:14 2003
@@ -92,7 +92,8 @@
inline void Dealer::Add (Player* newPlayer)
{
- for(int i=0; i < 10; i++)
+ int i;
+ for(i=0; i < 10; i++)
if( !_players[i] ){
_players[i] = newPlayer;
break;
@@ -102,8 +103,8 @@
inline void Dealer::Remove (Player* aplayer)
{
- int pos = 20;
- for(int i=0; _players[i]; i++)
+ int pos = 20, i;
+ for(i=0; _players[i]; i++)
if(aplayer == _players[i])
{
pos = i; break;

View File

@ -0,0 +1,38 @@
--- Deck.cpp.orig Tue Aug 19 12:02:29 2003
+++ Deck.cpp Tue Aug 19 12:05:01 2003
@@ -38,7 +38,8 @@
_globalCards[j] = Card(j);
_globalInit = 1;
}
- for(int i =0 ; i < _numOfCards; i++)
+ int i;
+ for(i =0 ; i < _numOfCards; i++)
_cards[i] = & _globalCards[i];
for(i=_numOfCards; i < 54; i++)
_cards[i] = (Card *) 0;
@@ -55,7 +56,7 @@
{
for (int i = 0; i < _numOfCards/2; i++)
to[i*2] = from[_numOfCards/2+i];
- for ( i = 0; i < _numOfCards/2; i++)
+ for (int i = 0; i < _numOfCards/2; i++)
to[i*2+1] = from[i];
Card **tmp = from;
from = to;
@@ -82,13 +83,13 @@
for(int i=_numOfCards-cut; i< _numOfCards; i++)
tmp[i] = _cards[i];
- for( i = _numOfCards-1; i >= cut; i--)
+ for(int i = _numOfCards-1; i >= cut; i--)
_cards[i] = _cards[i-cut];
- for( i = 0; i < cut; i++)
+ for(int i = 0; i < cut; i++)
_cards[ i ] = tmp[i + _numOfCards-cut];
#ifdef DEBUG
cout << "Cutting at " << _numOfCards-cut <<endl;
- for ( i = 0; i < _numOfCards; i++ ){
+ for (int i = 0; i < _numOfCards; i++ ){
if( i%10 == 0 ) cout << endl;
cout << _cards[i]->Suit() << (int)_cards[i]->Rank() << " ";
}

View File

@ -0,0 +1,86 @@
--- Hands.cpp.orig Fri Jan 31 23:47:58 1997
+++ Hands.cpp Tue Aug 19 12:11:29 2003
@@ -46,7 +46,7 @@
_next = 0;
}
-Hand Hands::HandValue() const
+enum Hands::Hand Hands::HandValue() const
{
return _hand;
}
@@ -93,7 +93,7 @@
Card** Hands::Cards() const
{
- return _cards;
+ return (Card**)_cards;
}
void Hands::SortCards() const
@@ -106,7 +106,7 @@
ranks[i] = _cards[i]->Rank();
for(int j=0; j < 4; j++) // sorting based on rank
- for( i=0; i < 4-j; i++)
+ for(int i=0; i < 4-j; i++)
{
if( ranks[i] < ranks[i+1] )
{
@@ -121,10 +121,10 @@
char r = ranks[0];
char board[4];
- for( i =0; i<4; i++) board[i] = '\0';
+ for(int i =0; i<4; i++) board[i] = '\0';
int s=1;
- for ( i=1; i< 6; i++)
+ for (int i=1; i< 6; i++)
{
if( r == ranks[i] ) s++;
else{
@@ -162,7 +162,8 @@
}
else{
if(ranks[0] == (char) '\14') ranks[5] = '\1';
- for( i =0; i < 4; i++)
+ int i;
+ for(i =0; i < 4; i++)
if(_cards[i]->Suit() != _cards[i+1]->Suit())
{
i = 8;
@@ -199,9 +200,9 @@
// rearrange cards order
Card* tmpcards[5];
- for(i = 0; i < 5; i++) tmpcards[i] = _cards[i];
- for(i = 0; i < 5; i++)
- for(j=0; j<5; j++)
+ for(int i = 0; i < 5; i++) tmpcards[i] = _cards[i];
+ for(int i = 0; i < 5; i++)
+ for(int j=0; j<5; j++)
if(tmpcards[j] && ranks[i]==tmpcards[j]->Rank())
{
((Hands*)this) ->_cards[i] = tmpcards[j];
@@ -210,7 +211,7 @@
}
#ifdef DEBUG
- for(i = 0; i < 5; i++)
+ for(int i = 0; i < 5; i++)
cout << _cards[i]->Suit() << (int) _cards[i]->Rank() << " ";
cout << endl;
#endif
@@ -219,9 +220,9 @@
void Hands::ReArrange(char* ranks , int nel,char* board, Hand score)
{
- int j=0 , k = 0;
+ int i, j=0 , k = 0;
char tmprank[10];
- for( int i = 0; i < nel; i++) // copy all the cards to the tmprank
+ for( i = 0; i < nel; i++) // copy all the cards to the tmprank
tmprank[i] = *(ranks+i);
tmprank[nel] = '\0';

View File

@ -0,0 +1,11 @@
--- Player.h.orig Tue Aug 19 12:00:36 2003
+++ Player.h Tue Aug 19 12:01:09 2003
@@ -72,7 +72,7 @@
int _lastWinLost;
};
-inline Player::WinLost( ) const
+inline int Player::WinLost( ) const
{
return _lastWinLost;
}

View File

@ -1,5 +1,5 @@
--- Seat.cpp Fri Jan 31 22:47:58 1997 --- Seat.cpp.orig Fri Jan 31 23:47:58 1997
+++ /home/andy/tmp/wrk/Seat.cpp Sat Jul 4 19:48:21 1998 +++ Seat.cpp Tue Aug 19 12:13:30 2003
@@ -151,10 +151,10 @@ @@ -151,10 +151,10 @@
gcv.font = XLoadFont(_dpy, "10x20"); gcv.font = XLoadFont(_dpy, "10x20");
gcflags = GCForeground | GCBackground | GCGraphicsExposures; gcflags = GCForeground | GCBackground | GCGraphicsExposures;
@ -13,3 +13,13 @@
i = 0; i = 0;
XtSetArg(args[i], XmNbackground, color.pixel); i++; XtSetArg(args[i], XmNbackground, color.pixel); i++;
XtSetArg(args[i], XmNforeground, whitepixel); i++; XtSetArg(args[i], XmNforeground, whitepixel); i++;
@@ -342,7 +342,8 @@
Card ** cards = hands->Cards();
if( hands->NumOfCards() )
{
- for(int i=0; i< hands->NumOfCards() -1; i++)
+ int i;
+ for(i=0; i< hands->NumOfCards() -1; i++)
DrawCardBack(GetWindow(), cards[i], PositionCardX(cards[i],i),
PositionCardY(cards[i],i));
DrawCard(GetWindow(), cards[i], PositionCardX(cards[i],i),

View File

@ -0,0 +1,11 @@
--- Seat.h.orig Tue Aug 19 12:12:00 2003
+++ Seat.h Tue Aug 19 12:12:40 2003
@@ -148,7 +148,7 @@
};
// Class Seat
-inline Seat::Available() const
+inline int Seat::Available() const
{
return _isAvailable;
}

View File

@ -0,0 +1,101 @@
--- Table.cpp.orig Tue Aug 19 12:13:59 2003
+++ Table.cpp Tue Aug 19 12:20:07 2003
@@ -306,7 +306,7 @@
XtSetArg(al[ac], XmNbottomAttachment, XmATTACH_POSITION); ac++;
XtSetArg(al[ac], XmNbottomPosition, 30); ac++;
XtSetArg(al[ac], XmNalignment, XmALIGNMENT_CENTER); ac++;
- for(j=0; j < rv.players; j++)
+ for(int j=0; j < rv.players; j++)
{
XtSetArg(al[ac], XmNtopWidget, YouHaveLabel[j]);
XtSetArg(al[ac+1], XmNleftPosition, j*100/rv.players);
@@ -324,7 +324,7 @@
XtSetArg(al[ac], XmNbottomAttachment, XmATTACH_POSITION); ac++;
XtSetArg(al[ac], XmNbottomPosition, 40); ac++;
XtSetArg(al[ac], XmNalignment, XmALIGNMENT_CENTER); ac++;
- for(j=0; j < rv.players; j++)
+ for(int j=0; j < rv.players; j++)
{
XtSetArg(al[ac], XmNtopWidget, YouHaveLabelValue[j]);
XtSetArg(al[ac+1], XmNleftPosition, j*100/rv.players);
@@ -465,7 +465,7 @@
XtManageChild(HelpRulesScrolledText);
- for(j=0; j< rv.players; j++)
+ for(int j=0; j< rv.players; j++)
{
ac = 0;
children[ac++] = YouHaveLabel[j];
@@ -534,7 +534,7 @@
Arg args[5];
i = 0;
- s = XmStringCreate(str, XmSTRING_DEFAULT_CHARSET);
+ s = XmStringCreate((char*)str, XmSTRING_DEFAULT_CHARSET);
XtSetArg(args[i], XmNmessageString, s); i++;
XtSetValues(ExceptionDialog, args, i);
XmStringFree(s);
@@ -586,7 +586,7 @@
try{
#ifdef DEBUG
cout << "Calling DealerDrawingAreaCB" << endl;
-#endif DEBUG
+#endif // DEBUG
if (call_data->window) {
XEvent event;
Table * table = (Table*) client_data;
@@ -615,7 +615,7 @@
try{
#ifdef DEBUG
cout << "Calling PlayerDrawingAreaCB" << endl;
-#endif DEBUG
+#endif // DEBUG
if (call_data->window) {
XEvent event;
@@ -648,7 +648,7 @@
{
#ifdef DEBUG
cout << "Calling AnteScrollCB" << endl;
-#endif DEBUG
+#endif // DEBUG
int i;
char str[80];
Arg args[5];
@@ -686,7 +686,7 @@
{
#ifdef DEBUG
cout << "Calling DealCB" << endl;
-#endif DEBUG
+#endif // DEBUG
Arg args[5];
char str[80];
XmScaleCallbackStruct data;
@@ -763,7 +763,7 @@
try{
#ifdef DEBUG
cout << "Calling BetCB" << endl;
-#endif DEBUG
+#endif // DEBUG
char str[80];
Arg args[5];
@@ -792,7 +792,7 @@
try{
#ifdef DEBUG
cout << "Calling FoldCB" << endl;
-#endif DEBUG
+#endif // DEBUG
char str[80];
Arg args[5];
@@ -823,7 +823,7 @@
try{
#ifdef DEBUG
cout << "Calling Table::PayTime" << endl;
-#endif DEBUG
+#endif // DEBUG
char str[80];
Arg args[5];

View File

@ -1,5 +1,5 @@
--- Xmakefile.orig Fri Jan 31 14:47:59 1997 --- Xmakefile.orig Fri Jan 31 23:47:59 1997
+++ Xmakefile Sun May 2 00:40:04 1999 +++ Xmakefile Tue Aug 19 11:56:52 2003
@@ -77,17 +77,27 @@ @@ -77,17 +77,27 @@
#UILFLAGS=-I/usr/include/uil -I/usr/include/Motif1.2/uil #UILFLAGS=-I/usr/include/uil -I/usr/include/Motif1.2/uil
### ###

View File

@ -1,11 +0,0 @@
--- Hands.cpp Fri Jan 31 22:47:58 1997
+++ /home/andy/tmp/wrk/Hands.cpp Sat Jul 4 18:54:30 1998
@@ -46,7 +46,7 @@
_next = 0;
}
-Hand Hands::HandValue() const
+enum Hands::Hand Hands::HandValue() const
{
return _hand;
}