ports/55733: [patch] Unbreak port: games/CaribbeanStud
Simon Barner
barner at in.tum.de
Wed Aug 20 09:40:34 UTC 2003
>Number: 55733
>Category: ports
>Synopsis: [patch] Unbreak port: games/CaribbeanStud
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: freebsd-ports-bugs
>State: open
>Quarter:
>Keywords:
>Date-Required:
>Class: change-request
>Submitter-Id: current-users
>Arrival-Date: Wed Aug 20 02:40:26 PDT 2003
>Closed-Date:
>Last-Modified:
>Originator: Simon Barner
>Release: FreeBSD 4.8-STABLE i386
>Organization:
>Environment:
System: FreeBSD zi025.glhnet.mhn.de 4.8-STABLE FreeBSD 4.8-STABLE #0: Thu Aug 7 04:04:01 CEST 2003 toor at zi025.glhnet.mhn.de:/usr/src/sys/compile/KISTE i386
>Description:
Port build now with both gcc 2.95.4 and 3.3.1. It also respects CFLAGS,
which it didn't before.
>How-To-Repeat:
>Fix:
Apply the following patch to the ports Makefile:
--- Makefile.orig Tue Aug 19 12:44:58 2003
+++ Makefile Tue Aug 19 12:43:17 2003
@@ -2,7 +2,7 @@
# Date created: 4 July 1998
# Whom: Andrey Zakhvatov
#
-# $FreeBSD: /repoman/r/pcvs/ports/games/CaribbeanStud/Makefile,v 1.10 2003/02/2
0 17:32:04 knu Exp $
+# $FreeBSD: ports/games/CaribbeanStud/Makefile,v 1.10 2003/02/20 17:32:04 knu E
xp $
#
PORTNAME= CaribbeanStud
@@ -18,7 +18,7 @@
MAKEFILE= Xmakefile
USE_MOTIF= yes
USE_X_PREFIX= yes
-CFLAGS= -pedantic
+CFLAGS+= -Wno-deprecated
do-install:
@ ${INSTALL_PROGRAM} ${WRKSRC}/CaribbeanStud ${PREFIX}/bin
Remove all patches from the files directory and use the following ones
instead:
# This is a shell archive. Save it in a file, remove anything before
# this line, and then unpack it by entering "sh file". Note, it may
# create directories; files and directories will be owned by you and
# have default permissions.
#
# This archive contains:
#
# patch-Card.h
# patch-Dealer.cpp
# patch-Dealer.h
# patch-Deck.cpp
# patch-Hands.cpp
# patch-Player.h
# patch-Seat.cpp
# patch-Seat.h
# patch-Table.cpp
# patch-Xmakefile
#
echo x - patch-Card.h
sed 's/^X//' >patch-Card.h << 'END-of-patch-Card.h'
X--- Card.h.orig Tue Aug 19 11:57:32 2003
X+++ Card.h Tue Aug 19 11:58:21 2003
X@@ -59,7 +59,7 @@
X
X // Class Card
X
X-inline Card::operator==(const Card &right) const
X+inline int Card::operator==(const Card &right) const
X {
X return ( _suit == right._suit &&
X (_rank == right._rank ||
X@@ -69,7 +69,7 @@
X );
X }
X
X-inline Card::operator!=(const Card &right) const
X+inline int Card::operator!=(const Card &right) const
X {
X return !( operator == (right) );
X }
END-of-patch-Card.h
echo x - patch-Dealer.cpp
sed 's/^X//' >patch-Dealer.cpp << 'END-of-patch-Dealer.cpp'
X--- Dealer.cpp.orig Tue Aug 19 12:01:24 2003
X+++ Dealer.cpp Tue Aug 19 12:02:07 2003
X@@ -141,7 +141,8 @@
X
X void Dealer::NewGame()
X {
X- for(int i=0; _players[i]; i++)
X+ int i;
X+ for(i=0; _players[i]; i++)
X _players[i]->NewGame();
X
X Hands::NewGame();
END-of-patch-Dealer.cpp
echo x - patch-Dealer.h
sed 's/^X//' >patch-Dealer.h << 'END-of-patch-Dealer.h'
X--- Dealer.h.orig Tue Aug 19 11:59:05 2003
X+++ Dealer.h Tue Aug 19 12:00:14 2003
X@@ -92,7 +92,8 @@
X
X inline void Dealer::Add (Player* newPlayer)
X {
X- for(int i=0; i < 10; i++)
X+ int i;
X+ for(i=0; i < 10; i++)
X if( !_players[i] ){
X _players[i] = newPlayer;
X break;
X@@ -102,8 +103,8 @@
X
X inline void Dealer::Remove (Player* aplayer)
X {
X- int pos = 20;
X- for(int i=0; _players[i]; i++)
X+ int pos = 20, i;
X+ for(i=0; _players[i]; i++)
X if(aplayer == _players[i])
X {
X pos = i; break;
END-of-patch-Dealer.h
echo x - patch-Deck.cpp
sed 's/^X//' >patch-Deck.cpp << 'END-of-patch-Deck.cpp'
X--- Deck.cpp.orig Tue Aug 19 12:02:29 2003
X+++ Deck.cpp Tue Aug 19 12:05:01 2003
X@@ -38,7 +38,8 @@
X _globalCards[j] = Card(j);
X _globalInit = 1;
X }
X- for(int i =0 ; i < _numOfCards; i++)
X+ int i;
X+ for(i =0 ; i < _numOfCards; i++)
X _cards[i] = & _globalCards[i];
X for(i=_numOfCards; i < 54; i++)
X _cards[i] = (Card *) 0;
X@@ -55,7 +56,7 @@
X {
X for (int i = 0; i < _numOfCards/2; i++)
X to[i*2] = from[_numOfCards/2+i];
X- for ( i = 0; i < _numOfCards/2; i++)
X+ for (int i = 0; i < _numOfCards/2; i++)
X to[i*2+1] = from[i];
X Card **tmp = from;
X from = to;
X@@ -82,13 +83,13 @@
X
X for(int i=_numOfCards-cut; i< _numOfCards; i++)
X tmp[i] = _cards[i];
X- for( i = _numOfCards-1; i >= cut; i--)
X+ for(int i = _numOfCards-1; i >= cut; i--)
X _cards[i] = _cards[i-cut];
X- for( i = 0; i < cut; i++)
X+ for(int i = 0; i < cut; i++)
X _cards[ i ] = tmp[i + _numOfCards-cut];
X #ifdef DEBUG
X cout << "Cutting at " << _numOfCards-cut <<endl;
X- for ( i = 0; i < _numOfCards; i++ ){
X+ for (int i = 0; i < _numOfCards; i++ ){
X if( i%10 == 0 ) cout << endl;
X cout << _cards[i]->Suit() << (int)_cards[i]->Rank() << " ";
X }
END-of-patch-Deck.cpp
echo x - patch-Hands.cpp
sed 's/^X//' >patch-Hands.cpp << 'END-of-patch-Hands.cpp'
X--- Hands.cpp.orig Fri Jan 31 23:47:58 1997
X+++ Hands.cpp Tue Aug 19 12:11:29 2003
X@@ -46,7 +46,7 @@
X _next = 0;
X }
X
X-Hand Hands::HandValue() const
X+enum Hands::Hand Hands::HandValue() const
X {
X return _hand;
X }
X@@ -93,7 +93,7 @@
X
X Card** Hands::Cards() const
X {
X- return _cards;
X+ return (Card**)_cards;
X }
X
X void Hands::SortCards() const
X@@ -106,7 +106,7 @@
X ranks[i] = _cards[i]->Rank();
X
X for(int j=0; j < 4; j++) // sorting based on rank
X- for( i=0; i < 4-j; i++)
X+ for(int i=0; i < 4-j; i++)
X {
X if( ranks[i] < ranks[i+1] )
X {
X@@ -121,10 +121,10 @@
X
X char r = ranks[0];
X char board[4];
X- for( i =0; i<4; i++) board[i] = '\0';
X+ for(int i =0; i<4; i++) board[i] = '\0';
X
X int s=1;
X- for ( i=1; i< 6; i++)
X+ for (int i=1; i< 6; i++)
X {
X if( r == ranks[i] ) s++;
X else{
X@@ -162,7 +162,8 @@
X }
X else{
X if(ranks[0] == (char) '\14') ranks[5] = '\1';
X- for( i =0; i < 4; i++)
X+ int i;
X+ for(i =0; i < 4; i++)
X if(_cards[i]->Suit() != _cards[i+1]->Suit())
X {
X i = 8;
X@@ -199,9 +200,9 @@
X // rearrange cards order
X
X Card* tmpcards[5];
X- for(i = 0; i < 5; i++) tmpcards[i] = _cards[i];
X- for(i = 0; i < 5; i++)
X- for(j=0; j<5; j++)
X+ for(int i = 0; i < 5; i++) tmpcards[i] = _cards[i];
X+ for(int i = 0; i < 5; i++)
X+ for(int j=0; j<5; j++)
X if(tmpcards[j] && ranks[i]==tmpcards[j]->Rank())
X {
X ((Hands*)this) ->_cards[i] = tmpcards[j];
X@@ -210,7 +211,7 @@
X }
X
X #ifdef DEBUG
X- for(i = 0; i < 5; i++)
X+ for(int i = 0; i < 5; i++)
X cout << _cards[i]->Suit() << (int) _cards[i]->Rank() << " ";
X cout << endl;
X #endif
X@@ -219,9 +220,9 @@
X
X void Hands::ReArrange(char* ranks , int nel,char* board, Hand score)
X {
X- int j=0 , k = 0;
X+ int i, j=0 , k = 0;
X char tmprank[10];
X- for( int i = 0; i < nel; i++) // copy all the cards to the tmprank
X+ for( i = 0; i < nel; i++) // copy all the cards to the tmprank
X tmprank[i] = *(ranks+i);
X tmprank[nel] = '\0';
X
END-of-patch-Hands.cpp
echo x - patch-Player.h
sed 's/^X//' >patch-Player.h << 'END-of-patch-Player.h'
X--- Player.h.orig Tue Aug 19 12:00:36 2003
X+++ Player.h Tue Aug 19 12:01:09 2003
X@@ -72,7 +72,7 @@
X int _lastWinLost;
X };
X
X-inline Player::WinLost( ) const
X+inline int Player::WinLost( ) const
X {
X return _lastWinLost;
X }
END-of-patch-Player.h
echo x - patch-Seat.cpp
sed 's/^X//' >patch-Seat.cpp << 'END-of-patch-Seat.cpp'
X--- Seat.cpp.orig Fri Jan 31 23:47:58 1997
X+++ Seat.cpp Tue Aug 19 12:13:30 2003
X@@ -151,10 +151,10 @@
X gcv.font = XLoadFont(_dpy, "10x20");
X gcflags = GCForeground | GCBackground | GCGraphicsExposures;
X _redgc = XCreateGC(_dpy, RootWindow(_dpy, _screen), gcflags, &gcv);
X+ // allocate drawing area background color, set areas
X+ XAllocNamedColor(_dpy, cmap, "Forest Green", &color, &color);
X
X }
X- // allocate drawing area background color, set areas
X- XAllocNamedColor(_dpy, cmap, "Forest Green", &color, &color);
X i = 0;
X XtSetArg(args[i], XmNbackground, color.pixel); i++;
X XtSetArg(args[i], XmNforeground, whitepixel); i++;
X@@ -342,7 +342,8 @@
X Card ** cards = hands->Cards();
X if( hands->NumOfCards() )
X {
X- for(int i=0; i< hands->NumOfCards() -1; i++)
X+ int i;
X+ for(i=0; i< hands->NumOfCards() -1; i++)
X DrawCardBack(GetWindow(), cards[i], PositionCardX(cards[i],i),
X PositionCardY(cards[i],i));
X DrawCard(GetWindow(), cards[i], PositionCardX(cards[i],i),
END-of-patch-Seat.cpp
echo x - patch-Seat.h
sed 's/^X//' >patch-Seat.h << 'END-of-patch-Seat.h'
X--- Seat.h.orig Tue Aug 19 12:12:00 2003
X+++ Seat.h Tue Aug 19 12:12:40 2003
X@@ -148,7 +148,7 @@
X };
X
X // Class Seat
X-inline Seat::Available() const
X+inline int Seat::Available() const
X {
X return _isAvailable;
X }
END-of-patch-Seat.h
echo x - patch-Table.cpp
sed 's/^X//' >patch-Table.cpp << 'END-of-patch-Table.cpp'
X--- Table.cpp.orig Tue Aug 19 12:13:59 2003
X+++ Table.cpp Tue Aug 19 12:20:07 2003
X@@ -306,7 +306,7 @@
X XtSetArg(al[ac], XmNbottomAttachment, XmATTACH_POSITION); ac++;
X XtSetArg(al[ac], XmNbottomPosition, 30); ac++;
X XtSetArg(al[ac], XmNalignment, XmALIGNMENT_CENTER); ac++;
X- for(j=0; j < rv.players; j++)
X+ for(int j=0; j < rv.players; j++)
X {
X XtSetArg(al[ac], XmNtopWidget, YouHaveLabel[j]);
X XtSetArg(al[ac+1], XmNleftPosition, j*100/rv.players);
X@@ -324,7 +324,7 @@
X XtSetArg(al[ac], XmNbottomAttachment, XmATTACH_POSITION); ac++;
X XtSetArg(al[ac], XmNbottomPosition, 40); ac++;
X XtSetArg(al[ac], XmNalignment, XmALIGNMENT_CENTER); ac++;
X- for(j=0; j < rv.players; j++)
X+ for(int j=0; j < rv.players; j++)
X {
X XtSetArg(al[ac], XmNtopWidget, YouHaveLabelValue[j]);
X XtSetArg(al[ac+1], XmNleftPosition, j*100/rv.players);
X@@ -465,7 +465,7 @@
X XtManageChild(HelpRulesScrolledText);
X
X
X- for(j=0; j< rv.players; j++)
X+ for(int j=0; j< rv.players; j++)
X {
X ac = 0;
X children[ac++] = YouHaveLabel[j];
X@@ -534,7 +534,7 @@
X Arg args[5];
X
X i = 0;
X- s = XmStringCreate(str, XmSTRING_DEFAULT_CHARSET);
X+ s = XmStringCreate((char*)str, XmSTRING_DEFAULT_CHARSET);
X XtSetArg(args[i], XmNmessageString, s); i++;
X XtSetValues(ExceptionDialog, args, i);
X XmStringFree(s);
X@@ -586,7 +586,7 @@
X try{
X #ifdef DEBUG
X cout << "Calling DealerDrawingAreaCB" << endl;
X-#endif DEBUG
X+#endif // DEBUG
X if (call_data->window) {
X XEvent event;
X Table * table = (Table*) client_data;
X@@ -615,7 +615,7 @@
X try{
X #ifdef DEBUG
X cout << "Calling PlayerDrawingAreaCB" << endl;
X-#endif DEBUG
X+#endif // DEBUG
X
X if (call_data->window) {
X XEvent event;
X@@ -648,7 +648,7 @@
X {
X #ifdef DEBUG
X cout << "Calling AnteScrollCB" << endl;
X-#endif DEBUG
X+#endif // DEBUG
X int i;
X char str[80];
X Arg args[5];
X@@ -686,7 +686,7 @@
X {
X #ifdef DEBUG
X cout << "Calling DealCB" << endl;
X-#endif DEBUG
X+#endif // DEBUG
X Arg args[5];
X char str[80];
X XmScaleCallbackStruct data;
X@@ -763,7 +763,7 @@
X try{
X #ifdef DEBUG
X cout << "Calling BetCB" << endl;
X-#endif DEBUG
X+#endif // DEBUG
X char str[80];
X Arg args[5];
X
X@@ -792,7 +792,7 @@
X try{
X #ifdef DEBUG
X cout << "Calling FoldCB" << endl;
X-#endif DEBUG
X+#endif // DEBUG
X
X char str[80];
X Arg args[5];
X@@ -823,7 +823,7 @@
X try{
X #ifdef DEBUG
X cout << "Calling Table::PayTime" << endl;
X-#endif DEBUG
X+#endif // DEBUG
X
X char str[80];
X Arg args[5];
END-of-patch-Table.cpp
echo x - patch-Xmakefile
sed 's/^X//' >patch-Xmakefile << 'END-of-patch-Xmakefile'
X--- Xmakefile.orig Fri Jan 31 23:47:59 1997
X+++ Xmakefile Tue Aug 19 11:56:52 2003
X@@ -77,17 +77,27 @@
X #UILFLAGS=-I/usr/include/uil -I/usr/include/Motif1.2/uil
X ###
X
X+## FreeBSD
X+##
X+XINCLUDES=-I$(X11BASE)/include
X+UILFLAGS=
X+CFLAGS+= -fhandle-exceptions -fno-for-scope
X+CXXFLAGS+= $(XINCLUDES)
X+LDFLAGS+=-L$(X11BASE)/lib
X+LDLIBS=
X+MOTIFLIBS=-lXm -lXmu -lXt -lX11 ${MOTIFLIB}
X+
X #LDLIBS = -lPW
X # Program configuration
X # ---------------------
X
X-LDFLAGS = ${XLIBS} $(MRMLIBS)
X-MOTIFLIBS = -lXm -lXmu -lXt -lX11
X+#LDFLAGS = ${XLIBS} $(MRMLIBS)
X+#MOTIFLIBS = -lXm -lXmu -lXt -lX11
X
X-CFLAGS= -g -I. ${XINCLUDES} $(UILFLAGS)
X-CCFLAGS=${CFLAGS}
X+#CFLAGS+= ${XINCLUDES} $(UILFLAGS)
X+#CCFLAGS=${CFLAGS}
X
X-UIL=uil
X+#UIL=uil
X
X #MOTIFLIBS = -lXm -lXt -lX11 -lPW
X
X@@ -122,7 +132,7 @@
X
X CaribbeanStud: $(OBJS)
X rm -f $@
X- $(CCC) $(CCFLAGS) -o $@ $(OBJS) $(LDFLAGS) $(LDLIBS) $(MOTIFLIBS)
X+ $(CXX) -o $@ $(OBJS) $(LDFLAGS) $(LDLIBS) $(MOTIFLIBS)
X
X depend:: $(SRCS) $(HEADERS)
X makedepend $(CFLAGS) $(CPPFLAGS) -- $(ALLDEFINES) -- $(SRCS)
X@@ -134,5 +144,5 @@
X
X .SUFFIXES: .cpp $(SUFFIXES)
X .cpp.o:
X- $(COMPILE.cc) $(OUTPUT_OPTION) $<
X+ $(CXX) -c $(CXXFLAGS) $(OUTPUT_OPTION) $<
X
END-of-patch-Xmakefile
exit
>Release-Note:
>Audit-Trail:
>Unformatted:
More information about the freebsd-ports-bugs
mailing list