diff -Nru dealer-20161012/ansidecl.h dealer-20190529+ds/ansidecl.h --- dealer-20161012/ansidecl.h 1970-01-01 00:00:00.000000000 +0000 +++ dealer-20190529+ds/ansidecl.h 2004-01-18 21:23:47.000000000 +0000 @@ -0,0 +1,108 @@ +/* Copyright (C) 1991 Free Software Foundation, Inc. +This file is part of the GNU C Library. + +The GNU C Library is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 1, or (at your option) +any later version. + +The GNU C Library is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with the GNU C Library; see the file COPYING. If not, write to +the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ + +/* ANSI and traditional C compatibility macros + + ANSI C is assumed if __STDC__ is #defined. + + Macro ANSI C definition Traditional C definition + ----- ---- - ---------- ----------- - ---------- + PTR `void *' `char *' + LONG_DOUBLE `long double' `double' + CONST `const' `' + VOLATILE `volatile' `' + SIGNED `signed' `' + PTRCONST `void *const' `char *' + + DEFUN(name, arglist, args) + + Defines function NAME. + + ARGLIST lists the arguments, separated by commas and enclosed in + parentheses. ARGLIST becomes the argument list in traditional C. + + ARGS list the arguments with their types. It becomes a prototype in + ANSI C, and the type declarations in traditional C. Arguments should + be separated with `AND'. For functions with a variable number of + arguments, the last thing listed should be `DOTS'. + + DEFUN_VOID(name) + + Defines a function NAME, which takes no arguments. + + EXFUN(name, prototype) + + Is used in an external function declaration. + In ANSI C it is `NAMEPROTOTYPE' (so PROTOTYPE should be enclosed in + parentheses). In traditional C it is `NAME()'. + For a function that takes no arguments, PROTOTYPE should be `(NOARGS)'. + + For example: + extern int EXFUN(printf, (CONST char *format DOTS)); + int DEFUN(fprintf, (stream, format), + FILE *stream AND CONST char *format DOTS) { ... } + void DEFUN_VOID(abort) { ... } +*/ + +#ifndef _ANSIDECL_H + +#define _ANSIDECL_H 1 + + +/* Every source file includes this file, + so they will all get the switch for lint. */ +/* LINTLIBRARY */ + + +#ifdef __STDC__ + +#define PTR void * +#define PTRCONST void *CONST +#define LONG_DOUBLE long double + +#define AND , +#define NOARGS void +#define CONST const +#define VOLATILE volatile +#define SIGNED signed +#define DOTS , ... + +#define EXFUN(name, proto) name proto +#define DEFUN(name, arglist, args) name(args) +#define DEFUN_VOID(name) name(NOARGS) + +#else /* Not ANSI C. */ + +#define PTR char * +#define PTRCONST PTR +#define LONG_DOUBLE double + +#define AND ; +#define NOARGS +#define CONST +#define VOLATILE +#define SIGNED +#define DOTS + +#define EXFUN(name, proto) name() +#define DEFUN(name, arglist, args) name arglist args; +#define DEFUN_VOID(name) name() + +#endif /* ANSI C. */ + + +#endif /* ansidecl.h */ diff -Nru dealer-20161012/dealer.c dealer-20190529+ds/dealer.c --- dealer-20161012/dealer.c 2004-05-30 11:34:47.000000000 +0000 +++ dealer-20190529+ds/dealer.c 2019-05-29 13:46:59.000000000 +0000 @@ -51,6 +51,7 @@ #define DEFAULT_MODE STAT_MODE #define RANDBITS 16 #define NRANDVALS (1<> (31 - RANDBITS)); #endif /* STD_RAND */ - j = zero52[k]; + j = zero52[k & NRANDMASK]; } while (j == 0xFF); } while (stacked_pack[j] != NO_CARD); @@ -1621,7 +1622,7 @@ } } if (argc - optind > 2 || errflg) { - fprintf (stderr, "Usage: %s [-emvu] [-s seed] [-p num] [-v num] [inputfile]\n", argv[0]); + fprintf (stderr, "Usage: %s [-023ehuvmqV] [-p n] [-g n] [-s seed] [-l n] [inputfile]\n", argv[0]); exit (-1); } if (optind < argc && freopen (input_file = argv[optind], "r", stdin) == NULL) { diff -Nru dealer-20161012/debian/changelog dealer-20190529+ds/debian/changelog --- dealer-20161012/debian/changelog 2018-09-25 19:57:31.000000000 +0000 +++ dealer-20190529+ds/debian/changelog 2019-07-28 18:02:00.000000000 +0000 @@ -1,3 +1,13 @@ +dealer (20190529+ds-1) unstable; urgency=medium + + * New upstream version. + * debian/copyright: Rewrite to DEP5 so Files-Excluded works. + * Exclude ._* from tarball, and while we are at it, other files not used by + the Debian package as well. + * Add debian/gitlab-ci.yml. + + -- Christoph Berg Sun, 28 Jul 2019 20:02:00 +0200 + dealer (20161012-4) unstable; urgency=medium * Repository moved to salsa. diff -Nru dealer-20161012/debian/copyright dealer-20190529+ds/debian/copyright --- dealer-20161012/debian/copyright 2017-11-20 19:54:25.000000000 +0000 +++ dealer-20190529+ds/debian/copyright 2019-07-28 17:50:02.000000000 +0000 @@ -1,75 +1,27 @@ -This package was debianized by Christoph Berg on -Fri, 17 Jun 2005 16:24:24 +0200. - -It was originally downloaded from: - http://www.dombo.org/henk/dealer.html -The homepage is now: - https://henku.home.xs4all.nl/software/dealer.html - -Authors: +Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ +Upstream-Name: dealer +Source: https://henku.home.xs4all.nl/software/dealer.html +Files-Excluded: + */._* + getopt.* + MSDOS/* + Random/* + __random.c +Comment: This package was debianized by Christoph Berg on + Fri, 17 Jun 2005 16:24:24 +0200. + . + It was originally downloaded from: + http://www.dombo.org/henk/dealer.html + +Files: * +Copyright: + Public domain. + Authors: Hans van Staveren Henk Uijterwaal - -Copyright Holder: - Public domain. - -License for dealer: - This program is hereby put in the public domain. Do with it whatever - you want, but I would like you not to redistribute it in modified form - without mentioning the fact of modification. I will accept bug reports - and modification requests, without any obligation of course, but fixing - bugs someone else put in is beyond me. - -License for getopt.c: - Copyright (C) 1987, 88, 89, 90, 91, 92, 93, 94, 95 - Free Software Foundation, Inc. - Modified (1993) from bison-1.20 by - Wilfred J. Hansen (wjh+@cmu.edu) - Andrew Consortium, Carnegie Mellon University - - This program is free software; you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by the - Free Software Foundation; either version 2, or (at your option) any - later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - -License for Random/(s)rand.c: - /* Copyright (C) 1991 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 of the - License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - -On Debian systems, the complete text of the GNU General -Public License can be found in `/usr/share/common-licenses/GPL'. - -License for Random/__random.c: - Copyright (c) 1983 Regents of the University of California. - All rights reserved. - - Redistribution and use in source and binary forms are permitted - provided that the above copyright notice and this paragraph are - duplicated in all such forms and that any documentation, - advertising materials, and other materials related to such - distribution and use acknowledge that the software was developed - by the University of California, Berkeley. The name of the - University may not be used to endorse or promote products derived - from this software without specific prior written permission. - THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR - IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED - WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. - - This is derived from the Berkeley source: - @(#)random.c 5.5 (Berkeley) 7/6/88 - It was reworked for the GNU C Library by Roland McGrath. +License: dealer + This program is hereby put in the public domain. Do with it whatever + you want, but I would like you not to redistribute it in modified form + without mentioning the fact of modification. I will accept bug reports + and modification requests, without any obligation of course, but fixing + bugs someone else put in is beyond me. diff -Nru dealer-20161012/debian/gitlab-ci.yml dealer-20190529+ds/debian/gitlab-ci.yml --- dealer-20161012/debian/gitlab-ci.yml 1970-01-01 00:00:00.000000000 +0000 +++ dealer-20190529+ds/debian/gitlab-ci.yml 2019-07-28 17:50:59.000000000 +0000 @@ -0,0 +1,6 @@ +include: + - https://salsa.debian.org/salsa-ci-team/pipeline/raw/master/salsa-ci.yml + - https://salsa.debian.org/salsa-ci-team/pipeline/raw/master/pipeline-jobs.yml + +reprotest: + extends: .test-reprotest-diffoscope diff -Nru dealer-20161012/debian/patches/dealer.c dealer-20190529+ds/debian/patches/dealer.c --- dealer-20161012/debian/patches/dealer.c 2018-09-25 19:55:23.000000000 +0000 +++ dealer-20190529+ds/debian/patches/dealer.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,30 +0,0 @@ -Mask k so zero52[k] doesn't overflow - ---- a/dealer.c -+++ b/dealer.c -@@ -51,6 +51,7 @@ - #define DEFAULT_MODE STAT_MODE - #define RANDBITS 16 - #define NRANDVALS (1<> (31 - RANDBITS)); - #endif /* STD_RAND */ -- j = zero52[k]; -+ j = zero52[k & NRANDMASK]; - } while (j == 0xFF); - } while (stacked_pack[j] != NO_CARD); - -@@ -1621,7 +1622,7 @@ - } - } - if (argc - optind > 2 || errflg) { -- fprintf (stderr, "Usage: %s [-emvu] [-s seed] [-p num] [-v num] [inputfile]\n", argv[0]); -+ fprintf (stderr, "Usage: %s [-023ehuvmqV] [-p n] [-g n] [-s seed] [-l n] [inputfile]\n", argv[0]); - exit (-1); - } - if (optind < argc && freopen (input_file = argv[optind], "r", stdin) == NULL) { diff -Nru dealer-20161012/debian/patches/makefile dealer-20190529+ds/debian/patches/makefile --- dealer-20161012/debian/patches/makefile 2018-09-25 19:55:23.000000000 +0000 +++ dealer-20190529+ds/debian/patches/makefile 2019-07-28 14:32:09.000000000 +0000 @@ -11,36 +11,35 @@ FLEX = flex YACC = yacc # Note: this should be the Berkeley Yacc, sometimes called byacc -@@ -10,22 +10,21 @@ PROGRAM = dealer +@@ -10,21 +10,22 @@ PROGRAM = dealer TARFILE = ${PROGRAM}.tar GZIPFILE = ${PROGRAM}.tar.gz --SRC = dealer.c pbn.c c4.c getopt.c pointcount.c +-SRC = dealer.c pbn.c c4.c getopt.c pointcount.c __random.c rand.c srand.c +SRC = dealer.c pbn.c c4.c pointcount.c LSRC = scan.l YSRC = defs.y HDR = dealer.h tree.h --OBJ = dealer.o defs.o pbn.o c4.o getopt.o pointcount.o +-OBJ = dealer.o defs.o pbn.o c4.o getopt.o pointcount.o __random.o rand.o srand.o +OBJ = dealer.o defs.o pbn.o c4.o pointcount.o LOBJ = scan.c YOBJ = defs.c +MAN = dealer.6 dealer.dpp.6 -- + -dealer: ${OBJ} ${LOBJ} ${YOBJ} -- ${MAKE} -C Random lib -- $(CC) -o $@ ${OBJ} -L./Random -lgnurand +- $(CC) -o $@ ${OBJ} +dealer: ${OBJ} ${LOBJ} ${YOBJ} ${MAN} + $(LINK.c) -o $@ ${OBJ} - + clean: - rm -f ${OBJ} ${LOBJ} ${YOBJ} + rm -f ${OBJ} ${LOBJ} ${YOBJ} ${MAN} ${MAKE} -C Examples clean - ${MAKE} -C Random clean -@@ -60,7 +59,13 @@ test: dealer + tarclean: clean ${YOBJ} +@@ -58,7 +59,13 @@ test: dealer # C-code # .c.o: @@ -55,3 +54,9 @@ # # File dependencies +@@ -69,5 +76,4 @@ dealer.o: tree.h scan.l dealer.h defs.c + pbn.o: tree.h scan.l dealer.h + defs.o: tree.h + c4.o: c4.c c4.h +-getopt.o: getopt.h + pointcount.o: pointcount.h diff -Nru dealer-20161012/debian/patches/series dealer-20190529+ds/debian/patches/series --- dealer-20161012/debian/patches/series 2018-09-25 19:55:23.000000000 +0000 +++ dealer-20190529+ds/debian/patches/series 2019-07-28 14:32:59.000000000 +0000 @@ -1,5 +1,4 @@ makefile -dealer.c manpages preprocessors mycalloc diff -Nru dealer-20161012/debian/watch dealer-20190529+ds/debian/watch --- dealer-20161012/debian/watch 2017-11-20 19:50:04.000000000 +0000 +++ dealer-20190529+ds/debian/watch 2019-07-28 17:44:41.000000000 +0000 @@ -1,2 +1,3 @@ version=4 +opts="dversionmangle=s/\+ds//, repacksuffix=+ds" \ https://henku.home.xs4all.nl/assets/downloads/dealer_([0-9].*).tar.* diff -Nru dealer-20161012/defs.c dealer-20190529+ds/defs.c --- dealer-20161012/defs.c 2016-10-12 17:15:35.000000000 +0000 +++ dealer-20190529+ds/defs.c 2019-05-29 15:35:24.000000000 +0000 @@ -1,8 +1,9 @@ -/* A Bison parser, made by GNU Bison 3.0.4. */ +/* A Bison parser, made by GNU Bison 3.3.2. */ /* Bison implementation for Yacc-like parsers in C - Copyright (C) 1984, 1989-1990, 2000-2015 Free Software Foundation, Inc. + Copyright (C) 1984, 1989-1990, 2000-2015, 2018-2019 Free Software Foundation, + Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -40,11 +41,14 @@ define necessary library symbols; they are noted "INFRINGES ON USER NAME SPACE" below. */ +/* Undocumented macros, especially those whose name start with YY_, + are private implementation details. Do not rely on them. */ + /* Identify Bison output. */ #define YYBISON 1 /* Bison version. */ -#define YYBISON_VERSION "3.0.4" +#define YYBISON_VERSION "3.3.2" /* Skeleton name. */ #define YYSKELETON_NAME "yacc.c" @@ -61,8 +65,8 @@ -/* Copy the first part of user declarations. */ -#line 1 "defs.y" /* yacc.c:339 */ +/* First part of user prologue. */ +#line 1 "defs.y" /* yacc.c:337 */ #include #include @@ -103,13 +107,16 @@ void insertshape(char s[4], int any, int neg_shape) ; void new_var(char *s, struct tree *t) ; -#line 107 "y.tab.c" /* yacc.c:339 */ - +#line 111 "y.tab.c" /* yacc.c:337 */ # ifndef YY_NULLPTR -# if defined __cplusplus && 201103L <= __cplusplus -# define YY_NULLPTR nullptr +# if defined __cplusplus +# if 201103L <= __cplusplus +# define YY_NULLPTR nullptr +# else +# define YY_NULLPTR 0 +# endif # else -# define YY_NULLPTR 0 +# define YY_NULLPTR ((void*)0) # endif # endif @@ -292,7 +299,7 @@ union YYSTYPE { -#line 43 "defs.y" /* yacc.c:355 */ +#line 43 "defs.y" /* yacc.c:352 */ int y_int; char *y_str; @@ -301,7 +308,7 @@ struct expr *y_expr; char y_distr[4]; -#line 305 "y.tab.c" /* yacc.c:355 */ +#line 312 "y.tab.c" /* yacc.c:352 */ }; typedef union YYSTYPE YYSTYPE; @@ -316,9 +323,7 @@ -/* Copy the second part of user declarations. */ -#line 322 "y.tab.c" /* yacc.c:358 */ #ifdef short # undef short @@ -339,13 +344,13 @@ #ifdef YYTYPE_UINT16 typedef YYTYPE_UINT16 yytype_uint16; #else -typedef unsigned short int yytype_uint16; +typedef unsigned short yytype_uint16; #endif #ifdef YYTYPE_INT16 typedef YYTYPE_INT16 yytype_int16; #else -typedef short int yytype_int16; +typedef short yytype_int16; #endif #ifndef YYSIZE_T @@ -357,7 +362,7 @@ # include /* INFRINGES ON USER NAME SPACE */ # define YYSIZE_T size_t # else -# define YYSIZE_T unsigned int +# define YYSIZE_T unsigned # endif #endif @@ -393,15 +398,6 @@ # define YY_ATTRIBUTE_UNUSED YY_ATTRIBUTE ((__unused__)) #endif -#if !defined _Noreturn \ - && (!defined __STDC_VERSION__ || __STDC_VERSION__ < 201112) -# if defined _MSC_VER && 1200 <= _MSC_VER -# define _Noreturn __declspec (noreturn) -# else -# define _Noreturn YY_ATTRIBUTE ((__noreturn__)) -# endif -#endif - /* Suppress unused-variable warnings by "using" E. */ #if ! defined lint || defined __GNUC__ # define YYUSE(E) ((void) (E)) @@ -409,7 +405,7 @@ # define YYUSE(E) /* empty */ #endif -#if defined __GNUC__ && 407 <= __GNUC__ * 100 + __GNUC_MINOR__ +#if defined __GNUC__ && ! defined __ICC && 407 <= __GNUC__ * 100 + __GNUC_MINOR__ /* Suppress an incorrect diagnostic about yylval being uninitialized. */ # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \ _Pragma ("GCC diagnostic push") \ @@ -571,16 +567,16 @@ /* YYNSTATES -- Number of states. */ #define YYNSTATES 292 -/* YYTRANSLATE[YYX] -- Symbol number corresponding to YYX as returned - by yylex, with out-of-bounds checking. */ #define YYUNDEFTOK 2 #define YYMAXUTOK 331 +/* YYTRANSLATE(TOKEN-NUM) -- Symbol number corresponding to TOKEN-NUM + as returned by yylex, with out-of-bounds checking. */ #define YYTRANSLATE(YYX) \ - ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) + ((unsigned) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) /* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM - as returned by yylex, without out-of-bounds checking. */ + as returned by yylex. */ static const yytype_uint8 yytranslate[] = { 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, @@ -991,22 +987,22 @@ #define YYRECOVERING() (!!yyerrstatus) -#define YYBACKUP(Token, Value) \ -do \ - if (yychar == YYEMPTY) \ - { \ - yychar = (Token); \ - yylval = (Value); \ - YYPOPSTACK (yylen); \ - yystate = *yyssp; \ - goto yybackup; \ - } \ - else \ - { \ - yyerror (YY_("syntax error: cannot back up")); \ - YYERROR; \ - } \ -while (0) +#define YYBACKUP(Token, Value) \ + do \ + if (yychar == YYEMPTY) \ + { \ + yychar = (Token); \ + yylval = (Value); \ + YYPOPSTACK (yylen); \ + yystate = *yyssp; \ + goto yybackup; \ + } \ + else \ + { \ + yyerror (YY_("syntax error: cannot back up")); \ + YYERROR; \ + } \ + while (0) /* Error token number */ #define YYTERROR 1 @@ -1046,37 +1042,37 @@ } while (0) -/*----------------------------------------. -| Print this symbol's value on YYOUTPUT. | -`----------------------------------------*/ +/*-----------------------------------. +| Print this symbol's value on YYO. | +`-----------------------------------*/ static void -yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep) +yy_symbol_value_print (FILE *yyo, int yytype, YYSTYPE const * const yyvaluep) { - FILE *yyo = yyoutput; - YYUSE (yyo); + FILE *yyoutput = yyo; + YYUSE (yyoutput); if (!yyvaluep) return; # ifdef YYPRINT if (yytype < YYNTOKENS) - YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep); + YYPRINT (yyo, yytoknum[yytype], *yyvaluep); # endif YYUSE (yytype); } -/*--------------------------------. -| Print this symbol on YYOUTPUT. | -`--------------------------------*/ +/*---------------------------. +| Print this symbol on YYO. | +`---------------------------*/ static void -yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep) +yy_symbol_print (FILE *yyo, int yytype, YYSTYPE const * const yyvaluep) { - YYFPRINTF (yyoutput, "%s %s (", + YYFPRINTF (yyo, "%s %s (", yytype < YYNTOKENS ? "token" : "nterm", yytname[yytype]); - yy_symbol_value_print (yyoutput, yytype, yyvaluep); - YYFPRINTF (yyoutput, ")"); + yy_symbol_value_print (yyo, yytype, yyvaluep); + YYFPRINTF (yyo, ")"); } /*------------------------------------------------------------------. @@ -1110,7 +1106,7 @@ static void yy_reduce_print (yytype_int16 *yyssp, YYSTYPE *yyvsp, int yyrule) { - unsigned long int yylno = yyrline[yyrule]; + unsigned long yylno = yyrline[yyrule]; int yynrhs = yyr2[yyrule]; int yyi; YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n", @@ -1121,7 +1117,7 @@ YYFPRINTF (stderr, " $%d = ", yyi + 1); yy_symbol_print (stderr, yystos[yyssp[yyi + 1 - yynrhs]], - &(yyvsp[(yyi + 1) - (yynrhs)]) + &yyvsp[(yyi + 1) - (yynrhs)] ); YYFPRINTF (stderr, "\n"); } @@ -1225,7 +1221,10 @@ case '\\': if (*++yyp != '\\') goto do_not_strip_quotes; - /* Fall through. */ + else + goto append; + + append: default: if (yyres) yyres[yyn] = *yyp; @@ -1243,7 +1242,7 @@ if (! yyres) return yystrlen (yystr); - return yystpcpy (yyres, yystr) - yyres; + return (YYSIZE_T) (yystpcpy (yyres, yystr) - yyres); } # endif @@ -1321,10 +1320,10 @@ yyarg[yycount++] = yytname[yyx]; { YYSIZE_T yysize1 = yysize + yytnamerr (YY_NULLPTR, yytname[yyx]); - if (! (yysize <= yysize1 - && yysize1 <= YYSTACK_ALLOC_MAXIMUM)) + if (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM) + yysize = yysize1; + else return 2; - yysize = yysize1; } } } @@ -1336,6 +1335,7 @@ case N: \ yyformat = S; \ break + default: /* Avoid compiler warnings. */ YYCASE_(0, YY_("syntax error")); YYCASE_(1, YY_("syntax error, unexpected %s")); YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s")); @@ -1347,9 +1347,10 @@ { YYSIZE_T yysize1 = yysize + yystrlen (yyformat); - if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM)) + if (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM) + yysize = yysize1; + else return 2; - yysize = yysize1; } if (*yymsg_alloc < yysize) @@ -1475,23 +1476,31 @@ yychar = YYEMPTY; /* Cause a token to be read. */ goto yysetstate; + /*------------------------------------------------------------. -| yynewstate -- Push a new state, which is found in yystate. | +| yynewstate -- push a new state, which is found in yystate. | `------------------------------------------------------------*/ - yynewstate: +yynewstate: /* In all cases, when you get here, the value and location stacks have just been pushed. So pushing a state here evens the stacks. */ yyssp++; - yysetstate: - *yyssp = yystate; + +/*--------------------------------------------------------------------. +| yynewstate -- set current state (the top of the stack) to yystate. | +`--------------------------------------------------------------------*/ +yysetstate: + *yyssp = (yytype_int16) yystate; if (yyss + yystacksize - 1 <= yyssp) +#if !defined yyoverflow && !defined YYSTACK_RELOCATE + goto yyexhaustedlab; +#else { /* Get the current used size of the three stacks, in elements. */ - YYSIZE_T yysize = yyssp - yyss + 1; + YYSIZE_T yysize = (YYSIZE_T) (yyssp - yyss + 1); -#ifdef yyoverflow +# if defined yyoverflow { /* Give user a chance to reallocate the stack. Use copies of these so that the &'s don't force the real ones into @@ -1507,14 +1516,10 @@ &yyss1, yysize * sizeof (*yyssp), &yyvs1, yysize * sizeof (*yyvsp), &yystacksize); - yyss = yyss1; yyvs = yyvs1; } -#else /* no yyoverflow */ -# ifndef YYSTACK_RELOCATE - goto yyexhaustedlab; -# else +# else /* defined YYSTACK_RELOCATE */ /* Extend the stack our own way. */ if (YYMAXDEPTH <= yystacksize) goto yyexhaustedlab; @@ -1530,22 +1535,22 @@ goto yyexhaustedlab; YYSTACK_RELOCATE (yyss_alloc, yyss); YYSTACK_RELOCATE (yyvs_alloc, yyvs); -# undef YYSTACK_RELOCATE +# undef YYSTACK_RELOCATE if (yyss1 != yyssa) YYSTACK_FREE (yyss1); } # endif -#endif /* no yyoverflow */ yyssp = yyss + yysize - 1; yyvsp = yyvs + yysize - 1; YYDPRINTF ((stderr, "Stack size increased to %lu\n", - (unsigned long int) yystacksize)); + (unsigned long) yystacksize)); if (yyss + yystacksize - 1 <= yyssp) YYABORT; } +#endif /* !defined yyoverflow && !defined YYSTACK_RELOCATE */ YYDPRINTF ((stderr, "Entering state %d\n", yystate)); @@ -1554,11 +1559,11 @@ goto yybackup; + /*-----------. | yybackup. | `-----------*/ yybackup: - /* Do appropriate processing given the current state. Read a lookahead token if we need one and don't already have one. */ @@ -1631,7 +1636,7 @@ /*-----------------------------. -| yyreduce -- Do a reduction. | +| yyreduce -- do a reduction. | `-----------------------------*/ yyreduce: /* yyn is the number of a rule to reduce with. */ @@ -1652,355 +1657,355 @@ switch (yyn) { case 4: -#line 152 "defs.y" /* yacc.c:1646 */ +#line 152 "defs.y" /* yacc.c:1652 */ { extern int maxgenerate; if(!maxgenerate) maxgenerate = (yyvsp[0].y_int); } -#line 1658 "y.tab.c" /* yacc.c:1646 */ +#line 1663 "y.tab.c" /* yacc.c:1652 */ break; case 5: -#line 154 "defs.y" /* yacc.c:1646 */ +#line 154 "defs.y" /* yacc.c:1652 */ { extern int maxproduce; if(!maxproduce) maxproduce = (yyvsp[0].y_int); } -#line 1664 "y.tab.c" /* yacc.c:1646 */ +#line 1669 "y.tab.c" /* yacc.c:1652 */ break; case 6: -#line 156 "defs.y" /* yacc.c:1646 */ +#line 156 "defs.y" /* yacc.c:1652 */ { extern int maxdealer; maxdealer = (yyvsp[0].y_int); } -#line 1672 "y.tab.c" /* yacc.c:1646 */ +#line 1677 "y.tab.c" /* yacc.c:1652 */ break; case 7: -#line 160 "defs.y" /* yacc.c:1646 */ +#line 160 "defs.y" /* yacc.c:1652 */ { extern int maxvuln; maxvuln = (yyvsp[0].y_int); } -#line 1680 "y.tab.c" /* yacc.c:1646 */ +#line 1685 "y.tab.c" /* yacc.c:1652 */ break; case 9: -#line 164 "defs.y" /* yacc.c:1646 */ +#line 164 "defs.y" /* yacc.c:1652 */ { clearpointcount(); pointcount_index=12;} -#line 1686 "y.tab.c" /* yacc.c:1646 */ +#line 1691 "y.tab.c" /* yacc.c:1652 */ break; case 11: -#line 166 "defs.y" /* yacc.c:1646 */ +#line 166 "defs.y" /* yacc.c:1652 */ { clearpointcount_alt((yyvsp[0].y_int)); pointcount_index=12;} -#line 1692 "y.tab.c" /* yacc.c:1646 */ +#line 1697 "y.tab.c" /* yacc.c:1652 */ break; case 13: -#line 168 "defs.y" /* yacc.c:1646 */ +#line 168 "defs.y" /* yacc.c:1652 */ { extern struct tree *decisiontree; decisiontree = (yyvsp[0].y_tree); } -#line 1698 "y.tab.c" /* yacc.c:1646 */ +#line 1703 "y.tab.c" /* yacc.c:1652 */ break; case 14: -#line 170 "defs.y" /* yacc.c:1646 */ +#line 170 "defs.y" /* yacc.c:1652 */ { extern struct tree *decisiontree; decisiontree = (yyvsp[0].y_tree); } -#line 1704 "y.tab.c" /* yacc.c:1646 */ +#line 1709 "y.tab.c" /* yacc.c:1652 */ break; case 15: -#line 172 "defs.y" /* yacc.c:1646 */ +#line 172 "defs.y" /* yacc.c:1652 */ { new_var((yyvsp[-2].y_str), (yyvsp[0].y_tree)); } -#line 1710 "y.tab.c" /* yacc.c:1646 */ +#line 1715 "y.tab.c" /* yacc.c:1652 */ break; case 16: -#line 174 "defs.y" /* yacc.c:1646 */ +#line 174 "defs.y" /* yacc.c:1652 */ { extern struct action *actionlist; actionlist = (yyvsp[0].y_action); } -#line 1716 "y.tab.c" /* yacc.c:1646 */ +#line 1721 "y.tab.c" /* yacc.c:1652 */ break; case 19: -#line 183 "defs.y" /* yacc.c:1646 */ +#line 183 "defs.y" /* yacc.c:1652 */ { predeal_compass = (yyvsp[0].y_int);} -#line 1722 "y.tab.c" /* yacc.c:1646 */ +#line 1727 "y.tab.c" /* yacc.c:1652 */ break; case 21: -#line 184 "defs.y" /* yacc.c:1646 */ +#line 184 "defs.y" /* yacc.c:1652 */ {bias_deal((yyvsp[-5].y_int),(yyvsp[-3].y_int),(yyvsp[0].y_int));} -#line 1728 "y.tab.c" /* yacc.c:1646 */ +#line 1733 "y.tab.c" /* yacc.c:1652 */ break; case 22: -#line 189 "defs.y" /* yacc.c:1646 */ +#line 189 "defs.y" /* yacc.c:1652 */ { predeal_holding(predeal_compass, (yyvsp[0].y_str)); } -#line 1734 "y.tab.c" /* yacc.c:1646 */ +#line 1739 "y.tab.c" /* yacc.c:1652 */ break; case 23: -#line 191 "defs.y" /* yacc.c:1646 */ +#line 191 "defs.y" /* yacc.c:1652 */ { predeal_holding(predeal_compass, (yyvsp[0].y_str)); } -#line 1740 "y.tab.c" /* yacc.c:1646 */ +#line 1745 "y.tab.c" /* yacc.c:1652 */ break; case 25: -#line 197 "defs.y" /* yacc.c:1646 */ +#line 197 "defs.y" /* yacc.c:1652 */ { pointcount(pointcount_index, (yyvsp[0].y_int)); pointcount_index--; } -#line 1748 "y.tab.c" /* yacc.c:1646 */ +#line 1753 "y.tab.c" /* yacc.c:1652 */ break; case 27: -#line 205 "defs.y" /* yacc.c:1646 */ +#line 205 "defs.y" /* yacc.c:1652 */ { extern int use_compass[NSUITS]; use_compass[(yyvsp[0].y_int)] = 1; (yyval.y_int)= (yyvsp[0].y_int); } -#line 1754 "y.tab.c" /* yacc.c:1646 */ +#line 1759 "y.tab.c" /* yacc.c:1652 */ break; case 28: -#line 210 "defs.y" /* yacc.c:1646 */ +#line 210 "defs.y" /* yacc.c:1652 */ { extern int use_vulnerable[NSUITS]; use_vulnerable[(yyvsp[0].y_int)] = 1; (yyval.y_int)= (yyvsp[0].y_int); } -#line 1760 "y.tab.c" /* yacc.c:1646 */ +#line 1765 "y.tab.c" /* yacc.c:1652 */ break; case 29: -#line 215 "defs.y" /* yacc.c:1646 */ +#line 215 "defs.y" /* yacc.c:1652 */ { (yyval.y_int) = 0; } -#line 1766 "y.tab.c" /* yacc.c:1646 */ +#line 1771 "y.tab.c" /* yacc.c:1652 */ break; case 30: -#line 217 "defs.y" /* yacc.c:1646 */ +#line 217 "defs.y" /* yacc.c:1652 */ { (yyval.y_int) = 0; } -#line 1772 "y.tab.c" /* yacc.c:1646 */ +#line 1777 "y.tab.c" /* yacc.c:1652 */ break; case 31: -#line 219 "defs.y" /* yacc.c:1646 */ +#line 219 "defs.y" /* yacc.c:1652 */ { (yyval.y_int) = 0; } -#line 1778 "y.tab.c" /* yacc.c:1646 */ +#line 1783 "y.tab.c" /* yacc.c:1652 */ break; case 32: -#line 221 "defs.y" /* yacc.c:1646 */ +#line 221 "defs.y" /* yacc.c:1652 */ { (yyval.y_int) = 1; } -#line 1784 "y.tab.c" /* yacc.c:1646 */ +#line 1789 "y.tab.c" /* yacc.c:1652 */ break; case 33: -#line 226 "defs.y" /* yacc.c:1646 */ +#line 226 "defs.y" /* yacc.c:1652 */ { (yyval.y_int) = 0; } -#line 1790 "y.tab.c" /* yacc.c:1646 */ +#line 1795 "y.tab.c" /* yacc.c:1652 */ break; case 34: -#line 228 "defs.y" /* yacc.c:1646 */ +#line 228 "defs.y" /* yacc.c:1652 */ { (yyval.y_int) = 1; } -#line 1796 "y.tab.c" /* yacc.c:1646 */ +#line 1801 "y.tab.c" /* yacc.c:1652 */ break; case 36: -#line 235 "defs.y" /* yacc.c:1646 */ +#line 235 "defs.y" /* yacc.c:1652 */ { (yyval.y_int) = - (yyvsp[0].y_int); } -#line 1802 "y.tab.c" /* yacc.c:1646 */ +#line 1807 "y.tab.c" /* yacc.c:1652 */ break; case 37: -#line 237 "defs.y" /* yacc.c:1646 */ +#line 237 "defs.y" /* yacc.c:1652 */ { (yyval.y_int) = d2n((yyvsp[0].y_distr)); } -#line 1808 "y.tab.c" /* yacc.c:1646 */ +#line 1813 "y.tab.c" /* yacc.c:1652 */ break; case 40: -#line 246 "defs.y" /* yacc.c:1646 */ +#line 246 "defs.y" /* yacc.c:1652 */ { insertshape((yyvsp[0].y_distr), (yyvsp[-1].y_int), (yyvsp[-2].y_int)); } -#line 1814 "y.tab.c" /* yacc.c:1646 */ +#line 1819 "y.tab.c" /* yacc.c:1652 */ break; case 43: -#line 256 "defs.y" /* yacc.c:1646 */ +#line 256 "defs.y" /* yacc.c:1652 */ { (yyval.y_tree) = newtree(TRT_NUMBER, NIL, NIL, (yyvsp[0].y_int), 0); } -#line 1820 "y.tab.c" /* yacc.c:1646 */ +#line 1825 "y.tab.c" /* yacc.c:1652 */ break; case 44: -#line 258 "defs.y" /* yacc.c:1646 */ +#line 258 "defs.y" /* yacc.c:1652 */ { (yyval.y_tree) = var_lookup((yyvsp[0].y_str), 1); } -#line 1826 "y.tab.c" /* yacc.c:1646 */ +#line 1831 "y.tab.c" /* yacc.c:1652 */ break; case 45: -#line 260 "defs.y" /* yacc.c:1646 */ +#line 260 "defs.y" /* yacc.c:1652 */ { (yyval.y_tree) = newtree(TRT_LENGTH, NIL, NIL, (yyvsp[-3].y_int), (yyvsp[-1].y_int)); } -#line 1832 "y.tab.c" /* yacc.c:1646 */ +#line 1837 "y.tab.c" /* yacc.c:1652 */ break; case 46: -#line 262 "defs.y" /* yacc.c:1646 */ +#line 262 "defs.y" /* yacc.c:1652 */ { (yyval.y_tree) = newtree(TRT_HCPTOTAL, NIL, NIL, (yyvsp[-1].y_int), 0); } -#line 1838 "y.tab.c" /* yacc.c:1646 */ +#line 1843 "y.tab.c" /* yacc.c:1652 */ break; case 47: -#line 264 "defs.y" /* yacc.c:1646 */ +#line 264 "defs.y" /* yacc.c:1652 */ { (yyval.y_tree) = newtree(TRT_HCP, NIL, NIL, (yyvsp[-3].y_int), (yyvsp[-1].y_int)); } -#line 1844 "y.tab.c" /* yacc.c:1646 */ +#line 1849 "y.tab.c" /* yacc.c:1652 */ break; case 48: -#line 266 "defs.y" /* yacc.c:1646 */ +#line 266 "defs.y" /* yacc.c:1652 */ { (yyval.y_tree) = newtree(TRT_PT0TOTAL, NIL, NIL, (yyvsp[-1].y_int), 0); } -#line 1850 "y.tab.c" /* yacc.c:1646 */ +#line 1855 "y.tab.c" /* yacc.c:1652 */ break; case 49: -#line 268 "defs.y" /* yacc.c:1646 */ +#line 268 "defs.y" /* yacc.c:1652 */ { (yyval.y_tree) = newtree(TRT_PT0, NIL, NIL, (yyvsp[-3].y_int), (yyvsp[-1].y_int)); } -#line 1856 "y.tab.c" /* yacc.c:1646 */ +#line 1861 "y.tab.c" /* yacc.c:1652 */ break; case 50: -#line 270 "defs.y" /* yacc.c:1646 */ +#line 270 "defs.y" /* yacc.c:1652 */ { (yyval.y_tree) = newtree(TRT_PT1TOTAL, NIL, NIL, (yyvsp[-1].y_int), 0); } -#line 1862 "y.tab.c" /* yacc.c:1646 */ +#line 1867 "y.tab.c" /* yacc.c:1652 */ break; case 51: -#line 272 "defs.y" /* yacc.c:1646 */ +#line 272 "defs.y" /* yacc.c:1652 */ { (yyval.y_tree) = newtree(TRT_PT1, NIL, NIL, (yyvsp[-3].y_int), (yyvsp[-1].y_int)); } -#line 1868 "y.tab.c" /* yacc.c:1646 */ +#line 1873 "y.tab.c" /* yacc.c:1652 */ break; case 52: -#line 274 "defs.y" /* yacc.c:1646 */ +#line 274 "defs.y" /* yacc.c:1652 */ { (yyval.y_tree) = newtree(TRT_PT2TOTAL, NIL, NIL, (yyvsp[-1].y_int), 0); } -#line 1874 "y.tab.c" /* yacc.c:1646 */ +#line 1879 "y.tab.c" /* yacc.c:1652 */ break; case 53: -#line 276 "defs.y" /* yacc.c:1646 */ +#line 276 "defs.y" /* yacc.c:1652 */ { (yyval.y_tree) = newtree(TRT_PT2, NIL, NIL, (yyvsp[-3].y_int), (yyvsp[-1].y_int)); } -#line 1880 "y.tab.c" /* yacc.c:1646 */ +#line 1885 "y.tab.c" /* yacc.c:1652 */ break; case 54: -#line 278 "defs.y" /* yacc.c:1646 */ +#line 278 "defs.y" /* yacc.c:1652 */ { (yyval.y_tree) = newtree(TRT_PT3TOTAL, NIL, NIL, (yyvsp[-1].y_int), 0); } -#line 1886 "y.tab.c" /* yacc.c:1646 */ +#line 1891 "y.tab.c" /* yacc.c:1652 */ break; case 55: -#line 280 "defs.y" /* yacc.c:1646 */ +#line 280 "defs.y" /* yacc.c:1652 */ { (yyval.y_tree) = newtree(TRT_PT3, NIL, NIL, (yyvsp[-3].y_int), (yyvsp[-1].y_int)); } -#line 1892 "y.tab.c" /* yacc.c:1646 */ +#line 1897 "y.tab.c" /* yacc.c:1652 */ break; case 56: -#line 282 "defs.y" /* yacc.c:1646 */ +#line 282 "defs.y" /* yacc.c:1652 */ { (yyval.y_tree) = newtree(TRT_PT4TOTAL, NIL, NIL, (yyvsp[-1].y_int), 0); } -#line 1898 "y.tab.c" /* yacc.c:1646 */ +#line 1903 "y.tab.c" /* yacc.c:1652 */ break; case 57: -#line 284 "defs.y" /* yacc.c:1646 */ +#line 284 "defs.y" /* yacc.c:1652 */ { (yyval.y_tree) = newtree(TRT_PT4, NIL, NIL, (yyvsp[-3].y_int), (yyvsp[-1].y_int)); } -#line 1904 "y.tab.c" /* yacc.c:1646 */ +#line 1909 "y.tab.c" /* yacc.c:1652 */ break; case 58: -#line 286 "defs.y" /* yacc.c:1646 */ +#line 286 "defs.y" /* yacc.c:1652 */ { (yyval.y_tree) = newtree(TRT_PT5TOTAL, NIL, NIL, (yyvsp[-1].y_int), 0); } -#line 1910 "y.tab.c" /* yacc.c:1646 */ +#line 1915 "y.tab.c" /* yacc.c:1652 */ break; case 59: -#line 288 "defs.y" /* yacc.c:1646 */ +#line 288 "defs.y" /* yacc.c:1652 */ { (yyval.y_tree) = newtree(TRT_PT5, NIL, NIL, (yyvsp[-3].y_int), (yyvsp[-1].y_int)); } -#line 1916 "y.tab.c" /* yacc.c:1646 */ +#line 1921 "y.tab.c" /* yacc.c:1652 */ break; case 60: -#line 290 "defs.y" /* yacc.c:1646 */ +#line 290 "defs.y" /* yacc.c:1652 */ { (yyval.y_tree) = newtree(TRT_PT6TOTAL, NIL, NIL, (yyvsp[-1].y_int), 0); } -#line 1922 "y.tab.c" /* yacc.c:1646 */ +#line 1927 "y.tab.c" /* yacc.c:1652 */ break; case 61: -#line 292 "defs.y" /* yacc.c:1646 */ +#line 292 "defs.y" /* yacc.c:1652 */ { (yyval.y_tree) = newtree(TRT_PT6, NIL, NIL, (yyvsp[-3].y_int), (yyvsp[-1].y_int)); } -#line 1928 "y.tab.c" /* yacc.c:1646 */ +#line 1933 "y.tab.c" /* yacc.c:1652 */ break; case 62: -#line 294 "defs.y" /* yacc.c:1646 */ +#line 294 "defs.y" /* yacc.c:1652 */ { (yyval.y_tree) = newtree(TRT_PT7TOTAL, NIL, NIL, (yyvsp[-1].y_int), 0); } -#line 1934 "y.tab.c" /* yacc.c:1646 */ +#line 1939 "y.tab.c" /* yacc.c:1652 */ break; case 63: -#line 296 "defs.y" /* yacc.c:1646 */ +#line 296 "defs.y" /* yacc.c:1652 */ { (yyval.y_tree) = newtree(TRT_PT7, NIL, NIL, (yyvsp[-3].y_int), (yyvsp[-1].y_int)); } -#line 1940 "y.tab.c" /* yacc.c:1646 */ +#line 1945 "y.tab.c" /* yacc.c:1652 */ break; case 64: -#line 298 "defs.y" /* yacc.c:1646 */ +#line 298 "defs.y" /* yacc.c:1652 */ { (yyval.y_tree) = newtree(TRT_PT8TOTAL, NIL, NIL, (yyvsp[-1].y_int), 0); } -#line 1946 "y.tab.c" /* yacc.c:1646 */ +#line 1951 "y.tab.c" /* yacc.c:1652 */ break; case 65: -#line 300 "defs.y" /* yacc.c:1646 */ +#line 300 "defs.y" /* yacc.c:1652 */ { (yyval.y_tree) = newtree(TRT_PT8, NIL, NIL, (yyvsp[-3].y_int), (yyvsp[-1].y_int)); } -#line 1952 "y.tab.c" /* yacc.c:1646 */ +#line 1957 "y.tab.c" /* yacc.c:1652 */ break; case 66: -#line 302 "defs.y" /* yacc.c:1646 */ +#line 302 "defs.y" /* yacc.c:1652 */ { (yyval.y_tree) = newtree(TRT_PT9TOTAL, NIL, NIL, (yyvsp[-1].y_int), 0); } -#line 1958 "y.tab.c" /* yacc.c:1646 */ +#line 1963 "y.tab.c" /* yacc.c:1652 */ break; case 67: -#line 304 "defs.y" /* yacc.c:1646 */ +#line 304 "defs.y" /* yacc.c:1652 */ { (yyval.y_tree) = newtree(TRT_PT9, NIL, NIL, (yyvsp[-3].y_int), (yyvsp[-1].y_int)); } -#line 1964 "y.tab.c" /* yacc.c:1646 */ +#line 1969 "y.tab.c" /* yacc.c:1652 */ break; case 68: -#line 306 "defs.y" /* yacc.c:1646 */ +#line 306 "defs.y" /* yacc.c:1652 */ { (yyval.y_tree) = newtree(TRT_LOSERTOTAL, NIL, NIL, (yyvsp[-1].y_int), 0); } -#line 1970 "y.tab.c" /* yacc.c:1646 */ +#line 1975 "y.tab.c" /* yacc.c:1652 */ break; case 69: -#line 308 "defs.y" /* yacc.c:1646 */ +#line 308 "defs.y" /* yacc.c:1652 */ { (yyval.y_tree) = newtree(TRT_LOSER, NIL, NIL, (yyvsp[-3].y_int), (yyvsp[-1].y_int)); } -#line 1976 "y.tab.c" /* yacc.c:1646 */ +#line 1981 "y.tab.c" /* yacc.c:1652 */ break; case 70: -#line 310 "defs.y" /* yacc.c:1646 */ +#line 310 "defs.y" /* yacc.c:1652 */ { (yyval.y_tree) = newtree(TRT_CONTROLTOTAL, NIL, NIL, (yyvsp[-1].y_int), 0); } -#line 1982 "y.tab.c" /* yacc.c:1646 */ +#line 1987 "y.tab.c" /* yacc.c:1652 */ break; case 71: -#line 312 "defs.y" /* yacc.c:1646 */ +#line 312 "defs.y" /* yacc.c:1652 */ { (yyval.y_tree) = newtree(TRT_CONTROL, NIL, NIL, (yyvsp[-3].y_int), (yyvsp[-1].y_int)); } -#line 1988 "y.tab.c" /* yacc.c:1646 */ +#line 1993 "y.tab.c" /* yacc.c:1652 */ break; case 72: -#line 314 "defs.y" /* yacc.c:1646 */ +#line 314 "defs.y" /* yacc.c:1652 */ { (yyval.y_tree) = newtree(TRT_CCCC, NIL, NIL, (yyvsp[-1].y_int), 0); } -#line 1994 "y.tab.c" /* yacc.c:1646 */ +#line 1999 "y.tab.c" /* yacc.c:1652 */ break; case 73: -#line 316 "defs.y" /* yacc.c:1646 */ +#line 316 "defs.y" /* yacc.c:1652 */ { (yyval.y_tree) = newtree(TRT_QUALITY, NIL, NIL, (yyvsp[-3].y_int), (yyvsp[-1].y_int)); } -#line 2000 "y.tab.c" /* yacc.c:1646 */ +#line 2005 "y.tab.c" /* yacc.c:1652 */ break; case 74: -#line 318 "defs.y" /* yacc.c:1646 */ +#line 318 "defs.y" /* yacc.c:1652 */ { (yyval.y_tree) = newtree(TRT_SHAPE, NIL, NIL, (yyvsp[-3].y_int), 1<<(shapeno++)); if (shapeno >= 32) { @@ -2008,272 +2013,272 @@ YYERROR; } } -#line 2012 "y.tab.c" /* yacc.c:1646 */ +#line 2017 "y.tab.c" /* yacc.c:1652 */ break; case 75: -#line 326 "defs.y" /* yacc.c:1646 */ +#line 326 "defs.y" /* yacc.c:1652 */ { (yyval.y_tree) = newtree(TRT_HASCARD, NIL, NIL, (yyvsp[-3].y_int), (yyvsp[-1].y_int)); } -#line 2018 "y.tab.c" /* yacc.c:1646 */ +#line 2023 "y.tab.c" /* yacc.c:1652 */ break; case 76: -#line 328 "defs.y" /* yacc.c:1646 */ +#line 328 "defs.y" /* yacc.c:1652 */ { (yyval.y_tree) = newtree(TRT_TRICKS, NIL, NIL, (yyvsp[-3].y_int), (yyvsp[-1].y_int)); } -#line 2024 "y.tab.c" /* yacc.c:1646 */ +#line 2029 "y.tab.c" /* yacc.c:1652 */ break; case 77: -#line 330 "defs.y" /* yacc.c:1646 */ +#line 330 "defs.y" /* yacc.c:1652 */ { (yyval.y_tree) = newtree(TRT_TRICKS, NIL, NIL, (yyvsp[-3].y_int), 4); } -#line 2030 "y.tab.c" /* yacc.c:1646 */ +#line 2035 "y.tab.c" /* yacc.c:1652 */ break; case 78: -#line 332 "defs.y" /* yacc.c:1646 */ +#line 332 "defs.y" /* yacc.c:1652 */ { (yyval.y_tree) = newtree(TRT_SCORE, (yyvsp[-1].y_tree), NIL, (yyvsp[-5].y_int), (yyvsp[-3].y_int)); } -#line 2036 "y.tab.c" /* yacc.c:1646 */ +#line 2041 "y.tab.c" /* yacc.c:1652 */ break; case 79: -#line 334 "defs.y" /* yacc.c:1646 */ +#line 334 "defs.y" /* yacc.c:1652 */ { (yyval.y_tree) = newtree(TRT_IMPS, (yyvsp[-1].y_tree), NIL, 0, 0); } -#line 2042 "y.tab.c" /* yacc.c:1646 */ +#line 2047 "y.tab.c" /* yacc.c:1652 */ break; case 80: -#line 336 "defs.y" /* yacc.c:1646 */ +#line 336 "defs.y" /* yacc.c:1652 */ { (yyval.y_tree) = (yyvsp[-1].y_tree); } -#line 2048 "y.tab.c" /* yacc.c:1646 */ +#line 2053 "y.tab.c" /* yacc.c:1652 */ break; case 81: -#line 338 "defs.y" /* yacc.c:1646 */ +#line 338 "defs.y" /* yacc.c:1652 */ { (yyval.y_tree) = newtree(TRT_CMPEQ, (yyvsp[-2].y_tree), (yyvsp[0].y_tree), 0, 0); } -#line 2054 "y.tab.c" /* yacc.c:1646 */ +#line 2059 "y.tab.c" /* yacc.c:1652 */ break; case 82: -#line 340 "defs.y" /* yacc.c:1646 */ +#line 340 "defs.y" /* yacc.c:1652 */ { (yyval.y_tree) = newtree(TRT_CMPNE, (yyvsp[-2].y_tree), (yyvsp[0].y_tree), 0, 0); } -#line 2060 "y.tab.c" /* yacc.c:1646 */ +#line 2065 "y.tab.c" /* yacc.c:1652 */ break; case 83: -#line 342 "defs.y" /* yacc.c:1646 */ +#line 342 "defs.y" /* yacc.c:1652 */ { (yyval.y_tree) = newtree(TRT_CMPLT, (yyvsp[-2].y_tree), (yyvsp[0].y_tree), 0, 0); } -#line 2066 "y.tab.c" /* yacc.c:1646 */ +#line 2071 "y.tab.c" /* yacc.c:1652 */ break; case 84: -#line 344 "defs.y" /* yacc.c:1646 */ +#line 344 "defs.y" /* yacc.c:1652 */ { (yyval.y_tree) = newtree(TRT_CMPLE, (yyvsp[-2].y_tree), (yyvsp[0].y_tree), 0, 0); } -#line 2072 "y.tab.c" /* yacc.c:1646 */ +#line 2077 "y.tab.c" /* yacc.c:1652 */ break; case 85: -#line 346 "defs.y" /* yacc.c:1646 */ +#line 346 "defs.y" /* yacc.c:1652 */ { (yyval.y_tree) = newtree(TRT_CMPGT, (yyvsp[-2].y_tree), (yyvsp[0].y_tree), 0, 0); } -#line 2078 "y.tab.c" /* yacc.c:1646 */ +#line 2083 "y.tab.c" /* yacc.c:1652 */ break; case 86: -#line 348 "defs.y" /* yacc.c:1646 */ +#line 348 "defs.y" /* yacc.c:1652 */ { (yyval.y_tree) = newtree(TRT_CMPGE, (yyvsp[-2].y_tree), (yyvsp[0].y_tree), 0, 0); } -#line 2084 "y.tab.c" /* yacc.c:1646 */ +#line 2089 "y.tab.c" /* yacc.c:1652 */ break; case 87: -#line 350 "defs.y" /* yacc.c:1646 */ +#line 350 "defs.y" /* yacc.c:1652 */ { (yyval.y_tree) = newtree(TRT_AND2, (yyvsp[-2].y_tree), (yyvsp[0].y_tree), 0, 0); } -#line 2090 "y.tab.c" /* yacc.c:1646 */ +#line 2095 "y.tab.c" /* yacc.c:1652 */ break; case 88: -#line 352 "defs.y" /* yacc.c:1646 */ +#line 352 "defs.y" /* yacc.c:1652 */ { (yyval.y_tree) = newtree(TRT_OR2, (yyvsp[-2].y_tree), (yyvsp[0].y_tree), 0, 0); } -#line 2096 "y.tab.c" /* yacc.c:1646 */ +#line 2101 "y.tab.c" /* yacc.c:1652 */ break; case 89: -#line 354 "defs.y" /* yacc.c:1646 */ +#line 354 "defs.y" /* yacc.c:1652 */ { (yyval.y_tree) = newtree(TRT_ARPLUS, (yyvsp[-2].y_tree), (yyvsp[0].y_tree), 0, 0); } -#line 2102 "y.tab.c" /* yacc.c:1646 */ +#line 2107 "y.tab.c" /* yacc.c:1652 */ break; case 90: -#line 356 "defs.y" /* yacc.c:1646 */ +#line 356 "defs.y" /* yacc.c:1652 */ { (yyval.y_tree) = newtree(TRT_ARMINUS, (yyvsp[-2].y_tree), (yyvsp[0].y_tree), 0, 0); } -#line 2108 "y.tab.c" /* yacc.c:1646 */ +#line 2113 "y.tab.c" /* yacc.c:1652 */ break; case 91: -#line 358 "defs.y" /* yacc.c:1646 */ +#line 358 "defs.y" /* yacc.c:1652 */ { (yyval.y_tree) = newtree(TRT_ARTIMES, (yyvsp[-2].y_tree), (yyvsp[0].y_tree), 0, 0); } -#line 2114 "y.tab.c" /* yacc.c:1646 */ +#line 2119 "y.tab.c" /* yacc.c:1652 */ break; case 92: -#line 360 "defs.y" /* yacc.c:1646 */ +#line 360 "defs.y" /* yacc.c:1652 */ { (yyval.y_tree) = newtree(TRT_ARDIVIDE, (yyvsp[-2].y_tree), (yyvsp[0].y_tree), 0, 0); } -#line 2120 "y.tab.c" /* yacc.c:1646 */ +#line 2125 "y.tab.c" /* yacc.c:1652 */ break; case 93: -#line 362 "defs.y" /* yacc.c:1646 */ +#line 362 "defs.y" /* yacc.c:1652 */ { (yyval.y_tree) = newtree(TRT_ARMOD, (yyvsp[-2].y_tree), (yyvsp[0].y_tree), 0, 0); } -#line 2126 "y.tab.c" /* yacc.c:1646 */ +#line 2131 "y.tab.c" /* yacc.c:1652 */ break; case 94: -#line 364 "defs.y" /* yacc.c:1646 */ +#line 364 "defs.y" /* yacc.c:1652 */ { (yyval.y_tree) = newtree(TRT_IF, (yyvsp[-4].y_tree), newtree(TRT_THENELSE, (yyvsp[-2].y_tree), (yyvsp[0].y_tree), 0, 0), 0, 0); } -#line 2132 "y.tab.c" /* yacc.c:1646 */ +#line 2137 "y.tab.c" /* yacc.c:1652 */ break; case 95: -#line 366 "defs.y" /* yacc.c:1646 */ +#line 366 "defs.y" /* yacc.c:1652 */ { (yyval.y_tree) = newtree(TRT_NOT, (yyvsp[0].y_tree), NIL, 0, 0); } -#line 2138 "y.tab.c" /* yacc.c:1646 */ +#line 2143 "y.tab.c" /* yacc.c:1652 */ break; case 96: -#line 368 "defs.y" /* yacc.c:1646 */ +#line 368 "defs.y" /* yacc.c:1652 */ { (yyval.y_tree) = newtree(TRT_RND, (yyvsp[-1].y_tree), NIL, 0, 0); } -#line 2144 "y.tab.c" /* yacc.c:1646 */ +#line 2149 "y.tab.c" /* yacc.c:1652 */ break; case 97: -#line 373 "defs.y" /* yacc.c:1646 */ +#line 373 "defs.y" /* yacc.c:1652 */ { (yyval.y_expr) = newexpr((yyvsp[0].y_tree), 0, 0); } -#line 2150 "y.tab.c" /* yacc.c:1646 */ +#line 2155 "y.tab.c" /* yacc.c:1652 */ break; case 98: -#line 375 "defs.y" /* yacc.c:1646 */ +#line 375 "defs.y" /* yacc.c:1652 */ { (yyval.y_expr) = newexpr(0, (yyvsp[0].y_str), 0); } -#line 2156 "y.tab.c" /* yacc.c:1646 */ +#line 2161 "y.tab.c" /* yacc.c:1652 */ break; case 99: -#line 377 "defs.y" /* yacc.c:1646 */ +#line 377 "defs.y" /* yacc.c:1652 */ { (yyval.y_expr) = newexpr((yyvsp[0].y_tree), 0, (yyvsp[-2].y_expr)); } -#line 2162 "y.tab.c" /* yacc.c:1646 */ +#line 2167 "y.tab.c" /* yacc.c:1652 */ break; case 100: -#line 379 "defs.y" /* yacc.c:1646 */ +#line 379 "defs.y" /* yacc.c:1652 */ { (yyval.y_expr) = newexpr(0, (yyvsp[0].y_str), (yyvsp[-2].y_expr)); } -#line 2168 "y.tab.c" /* yacc.c:1646 */ +#line 2173 "y.tab.c" /* yacc.c:1652 */ break; case 101: -#line 384 "defs.y" /* yacc.c:1646 */ +#line 384 "defs.y" /* yacc.c:1652 */ { (yyval.y_action) = (yyvsp[0].y_action); } -#line 2174 "y.tab.c" /* yacc.c:1646 */ +#line 2179 "y.tab.c" /* yacc.c:1652 */ break; case 102: -#line 386 "defs.y" /* yacc.c:1646 */ +#line 386 "defs.y" /* yacc.c:1652 */ { (yyval.y_action) = (yyvsp[-2].y_action); (yyval.y_action)->ac_next = (yyvsp[0].y_action); } -#line 2180 "y.tab.c" /* yacc.c:1646 */ +#line 2185 "y.tab.c" /* yacc.c:1652 */ break; case 103: -#line 388 "defs.y" /* yacc.c:1646 */ +#line 388 "defs.y" /* yacc.c:1652 */ { (yyval.y_action) = 0; } -#line 2186 "y.tab.c" /* yacc.c:1646 */ +#line 2191 "y.tab.c" /* yacc.c:1652 */ break; case 104: -#line 392 "defs.y" /* yacc.c:1646 */ +#line 392 "defs.y" /* yacc.c:1652 */ { will_print++; (yyval.y_action) = newaction(ACT_PRINTALL, NIL, (char *) 0, 0, NIL); } -#line 2194 "y.tab.c" /* yacc.c:1646 */ +#line 2199 "y.tab.c" /* yacc.c:1652 */ break; case 105: -#line 396 "defs.y" /* yacc.c:1646 */ +#line 396 "defs.y" /* yacc.c:1652 */ { will_print++; (yyval.y_action) = newaction(ACT_PRINTEW, NIL, (char *) 0, 0, NIL); } -#line 2202 "y.tab.c" /* yacc.c:1646 */ +#line 2207 "y.tab.c" /* yacc.c:1652 */ break; case 106: -#line 400 "defs.y" /* yacc.c:1646 */ +#line 400 "defs.y" /* yacc.c:1652 */ { will_print++; (yyval.y_action) = newaction(ACT_PRINT, NIL, (char *) 0, (yyvsp[-1].y_int), NIL); } -#line 2210 "y.tab.c" /* yacc.c:1646 */ +#line 2215 "y.tab.c" /* yacc.c:1652 */ break; case 107: -#line 404 "defs.y" /* yacc.c:1646 */ +#line 404 "defs.y" /* yacc.c:1652 */ { will_print++; (yyval.y_action)=newaction(ACT_PRINTCOMPACT,NIL,0,0, NIL);} -#line 2217 "y.tab.c" /* yacc.c:1646 */ +#line 2222 "y.tab.c" /* yacc.c:1652 */ break; case 108: -#line 407 "defs.y" /* yacc.c:1646 */ +#line 407 "defs.y" /* yacc.c:1652 */ { will_print++; (yyval.y_action) = newaction(ACT_PRINTONELINE, NIL, 0, 0, NIL);} -#line 2224 "y.tab.c" /* yacc.c:1646 */ +#line 2229 "y.tab.c" /* yacc.c:1652 */ break; case 109: -#line 410 "defs.y" /* yacc.c:1646 */ +#line 410 "defs.y" /* yacc.c:1652 */ { will_print++; (yyval.y_action)=newaction(ACT_PRINTPBN,NIL,0,0, NIL);} -#line 2231 "y.tab.c" /* yacc.c:1646 */ +#line 2236 "y.tab.c" /* yacc.c:1652 */ break; case 110: -#line 413 "defs.y" /* yacc.c:1646 */ +#line 413 "defs.y" /* yacc.c:1652 */ { will_print++; (yyval.y_action)=newaction(ACT_PRINTES,(struct tree*)(yyvsp[-1].y_expr),0,0, NIL); } -#line 2238 "y.tab.c" /* yacc.c:1646 */ +#line 2243 "y.tab.c" /* yacc.c:1652 */ break; case 111: -#line 416 "defs.y" /* yacc.c:1646 */ +#line 416 "defs.y" /* yacc.c:1652 */ { will_print++; (yyval.y_action)=newaction(ACT_EVALCONTRACT,0,0,0, NIL);} -#line 2245 "y.tab.c" /* yacc.c:1646 */ +#line 2250 "y.tab.c" /* yacc.c:1652 */ break; case 112: -#line 419 "defs.y" /* yacc.c:1646 */ +#line 419 "defs.y" /* yacc.c:1652 */ { will_print++; (yyval.y_action)=newaction(ACT_PRINTCOMPACT,(yyvsp[-1].y_tree),0,0, NIL);} -#line 2252 "y.tab.c" /* yacc.c:1646 */ +#line 2257 "y.tab.c" /* yacc.c:1652 */ break; case 113: -#line 422 "defs.y" /* yacc.c:1646 */ +#line 422 "defs.y" /* yacc.c:1652 */ { will_print++; (yyval.y_action)=newaction(ACT_PRINTONELINE,(yyvsp[-1].y_tree),0,0, NIL);} -#line 2259 "y.tab.c" /* yacc.c:1646 */ +#line 2264 "y.tab.c" /* yacc.c:1652 */ break; case 114: -#line 425 "defs.y" /* yacc.c:1646 */ +#line 425 "defs.y" /* yacc.c:1652 */ { (yyval.y_action) = newaction(ACT_AVERAGE, (yyvsp[0].y_tree), (yyvsp[-1].y_str), 0, NIL); } -#line 2265 "y.tab.c" /* yacc.c:1646 */ +#line 2270 "y.tab.c" /* yacc.c:1652 */ break; case 115: -#line 427 "defs.y" /* yacc.c:1646 */ +#line 427 "defs.y" /* yacc.c:1652 */ { (yyval.y_action) = newaction(ACT_FREQUENCY, (yyvsp[-5].y_tree), (yyvsp[-7].y_str), 0, NIL); (yyval.y_action)->ac_u.acu_f.acuf_lowbnd = (yyvsp[-3].y_int); (yyval.y_action)->ac_u.acu_f.acuf_highbnd = (yyvsp[-1].y_int);} -#line 2273 "y.tab.c" /* yacc.c:1646 */ +#line 2278 "y.tab.c" /* yacc.c:1652 */ break; case 116: -#line 431 "defs.y" /* yacc.c:1646 */ +#line 431 "defs.y" /* yacc.c:1652 */ { (yyval.y_action) = newaction(ACT_FREQUENCY2D, (yyvsp[-11].y_tree), (yyvsp[-13].y_str), 0, (yyvsp[-5].y_tree)); (yyval.y_action)->ac_u.acu_f2d.acuf_lowbnd_expr1 = (yyvsp[-9].y_int); @@ -2281,35 +2286,35 @@ (yyval.y_action)->ac_u.acu_f2d.acuf_lowbnd_expr2 = (yyvsp[-3].y_int); (yyval.y_action)->ac_u.acu_f2d.acuf_highbnd_expr2 = (yyvsp[-1].y_int); } -#line 2285 "y.tab.c" /* yacc.c:1646 */ +#line 2290 "y.tab.c" /* yacc.c:1652 */ break; case 117: -#line 441 "defs.y" /* yacc.c:1646 */ +#line 441 "defs.y" /* yacc.c:1652 */ { (yyval.y_str) = (char *) 0; } -#line 2291 "y.tab.c" /* yacc.c:1646 */ +#line 2296 "y.tab.c" /* yacc.c:1652 */ break; case 118: -#line 443 "defs.y" /* yacc.c:1646 */ +#line 443 "defs.y" /* yacc.c:1652 */ { (yyval.y_str) = (yyvsp[0].y_str); } -#line 2297 "y.tab.c" /* yacc.c:1646 */ +#line 2302 "y.tab.c" /* yacc.c:1652 */ break; case 119: -#line 447 "defs.y" /* yacc.c:1646 */ +#line 447 "defs.y" /* yacc.c:1652 */ { (yyval.y_int) = (1<<(yyvsp[0].y_int)); } -#line 2303 "y.tab.c" /* yacc.c:1646 */ +#line 2308 "y.tab.c" /* yacc.c:1652 */ break; case 120: -#line 449 "defs.y" /* yacc.c:1646 */ +#line 449 "defs.y" /* yacc.c:1652 */ { (yyval.y_int) = (yyvsp[-2].y_int)|(1<<(yyvsp[0].y_int)); } -#line 2309 "y.tab.c" /* yacc.c:1646 */ +#line 2314 "y.tab.c" /* yacc.c:1652 */ break; -#line 2313 "y.tab.c" /* yacc.c:1646 */ +#line 2318 "y.tab.c" /* yacc.c:1652 */ default: break; } /* User semantic actions sometimes alter yychar, and that requires @@ -2334,14 +2339,13 @@ /* Now 'shift' the result of the reduction. Determine what state that goes to, based on the state we popped back to and the rule number reduced by. */ - - yyn = yyr1[yyn]; - - yystate = yypgoto[yyn - YYNTOKENS] + *yyssp; - if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp) - yystate = yytable[yystate]; - else - yystate = yydefgoto[yyn - YYNTOKENS]; + { + const int yylhs = yyr1[yyn] - YYNTOKENS; + const int yyi = yypgoto[yylhs] + *yyssp; + yystate = (0 <= yyi && yyi <= YYLAST && yycheck[yyi] == *yyssp + ? yytable[yyi] + : yydefgoto[yylhs]); + } goto yynewstate; @@ -2424,12 +2428,10 @@ | yyerrorlab -- error raised explicitly by YYERROR. | `---------------------------------------------------*/ yyerrorlab: - - /* Pacify compilers like GCC when the user code never invokes - YYERROR and the label yyerrorlab therefore never appears in user - code. */ - if (/*CONSTCOND*/ 0) - goto yyerrorlab; + /* Pacify compilers when the user code never invokes YYERROR and the + label yyerrorlab therefore never appears in user code. */ + if (0) + YYERROR; /* Do not reclaim the symbols of the rule whose action triggered this YYERROR. */ @@ -2491,6 +2493,7 @@ yyresult = 0; goto yyreturn; + /*-----------------------------------. | yyabortlab -- YYABORT comes here. | `-----------------------------------*/ @@ -2498,6 +2501,7 @@ yyresult = 1; goto yyreturn; + #if !defined yyoverflow || YYERROR_VERBOSE /*-------------------------------------------------. | yyexhaustedlab -- memory exhaustion comes here. | @@ -2508,6 +2512,10 @@ /* Fall through. */ #endif + +/*-----------------------------------------------------. +| yyreturn -- parsing is finished, return the result. | +`-----------------------------------------------------*/ yyreturn: if (yychar != YYEMPTY) { @@ -2537,7 +2545,7 @@ #endif return yyresult; } -#line 451 "defs.y" /* yacc.c:1906 */ +#line 451 "defs.y" /* yacc.c:1918 */ struct var { diff -Nru dealer-20161012/Examples/Descr.1c dealer-20190529+ds/Examples/Descr.1c --- dealer-20161012/Examples/Descr.1c 1970-01-01 00:00:00.000000000 +0000 +++ dealer-20190529+ds/Examples/Descr.1c 2017-07-24 06:55:48.000000000 +0000 @@ -0,0 +1,27 @@ +# Opening bid is 11+ +westopen = hcp(west) >= 11 + +# 1NT 15-17, 4333, 4432, 5332 including 5M +west1nt = hcp(west) >= 15 && + hcp(west) <= 17 && + shape(west, any 4333 + any 4432 + any 5332) + +# Open 1M if 5+ +west1h = hearts(west)>=5 +west1s = spades(west)>=5 + +# Open 1D if 4+ but not with 32M-44m +west1d = diamonds(west) >= 4 && + !(shape(west, 3244 + 2344)) + && (diamonds(west) >= clubs(west)) + +# All other hands open 1C +west1d1n = (west1h || west1s || west1d || west1nt) +west1c = westopen && !west1d1n + +condition west1c +produce 100000 + +action + average "Clubs held by W" clubs(west), + frequency "Number of clubs" (clubs(west), 0, 13) diff -Nru dealer-20161012/Examples/Descr.2nt dealer-20190529+ds/Examples/Descr.2nt --- dealer-20161012/Examples/Descr.2nt 1970-01-01 00:00:00.000000000 +0000 +++ dealer-20190529+ds/Examples/Descr.2nt 2019-04-03 11:19:47.000000000 +0000 @@ -0,0 +1,16 @@ +east_notrump = + shape(east, any 4333 + any 4432 + any 5332 - 5xxx - x5xx) + && hcp(east)>=23 && hcp(east)<25 + +west_stayman = hcp(west)>3 && (hearts(west)==4 || spades(west)==4) + +west_jacoby = hearts(west)>4 || spades(west)>4 + +condition + east_notrump && (west_stayman || west_jacoby) + +produce + 10 + +action + printall diff -Nru dealer-20161012/getopt.c dealer-20190529+ds/getopt.c --- dealer-20161012/getopt.c 2004-01-18 21:23:49.000000000 +0000 +++ dealer-20190529+ds/getopt.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,609 +0,0 @@ -/* Getopt for GNU. - Copyright (C) 1987, 88, 89, 90, 91, 92, 93, 94, 95 - Free Software Foundation, Inc. - Modified (1993) from bison-1.20 by - Wilfred J. Hansen (wjh+@cmu.edu) - Andrew Consortium, Carnegie Mellon University - - This program is free software; you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by the - Free Software Foundation; either version 2, or (at your option) any - later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ - -#include - -#include - -#define gettext(msgid) (msgid) - -/* This version of `getopt' appears to the caller like standard Unix `getopt' - but it behaves differently for the user, since it allows the user - to intersperse the options with the other arguments. - - As `getopt' works, it permutes the elements of ARGV so that, - when it is done, all the options precede everything else. Thus - all application programs are extended to handle flexible argument order. - - Setting the environment variable POSIXLY_CORRECT disables permutation. - Then the behavior is completely standard. - - GNU application programs can use a third alternative mode in which - they can distinguish the relative order of options and other arguments. */ - -#include "getopt.h" - -/* For communication from `getopt' to the caller. - When `getopt' finds an option that takes an argument, - the argument value is returned here. - Also, when `ordering' is RETURN_IN_ORDER, - each non-option ARGV-element is returned here. */ - -char *optarg = NULL; - -/* Index in ARGV of the next element to be scanned. - This is used for communication to and from the caller - and for communication between successive calls to `getopt'. - - On entry to `getopt', zero means this is the first call; initialize. - - When `getopt' returns EOF, this is the index of the first of the - non-option elements that the caller should itself scan. - - Otherwise, `optind' communicates from one call to the next - how much of ARGV has been scanned so far. */ - -/* XXX 1003.2 says this must be 1 before any call. */ -int optind = 0; - -/* The next char to be scanned in the option-element - in which the last option character we returned was found. - This allows us to pick up the scan where we left off. - - If this is zero, or a null string, it means resume the scan - by advancing to the next ARGV-element. */ - -static char *nextchar; - -/* Callers store zero here to inhibit the error message - for unrecognized options. */ - -int opterr = 1; - -/* Set to an option character which was unrecognized. - This must be initialized on some systems to avoid linking in the - system's own getopt implementation. */ - -int optopt = '?'; - -/* Describe how to deal with options that follow non-option ARGV-elements. - - If the caller did not specify anything, - the default is REQUIRE_ORDER if the environment variable - POSIXLY_CORRECT is defined, PERMUTE otherwise. - - REQUIRE_ORDER means don't recognize them as options; - stop option processing when the first non-option is seen. - This is what Unix does. - This mode of operation is selected by either setting the environment - variable POSIXLY_CORRECT, or using `+' as the first character - of the list of option characters. - - PERMUTE is the default. We permute the contents of ARGV as we scan, - so that eventually all the non-options are at the end. This allows options - to be given in any order, even with programs that were not written to - expect this. - - RETURN_IN_ORDER is an option available to programs that were written - to expect options and other ARGV-elements in any order and that care about - the ordering of the two. We describe each non-option ARGV-element - as if it were the argument of an option with character code 1. - Using `-' as the first character of the list of option characters - selects this mode of operation. - - The special argument `--' forces an end of option-scanning regardless - of the value of `ordering'. In the case of RETURN_IN_ORDER, only - `--' can cause `getopt' to return EOF with `optind' != ARGC. */ - -static enum -{ - REQUIRE_ORDER, PERMUTE, RETURN_IN_ORDER -} ordering; - -/* Value of POSIXLY_CORRECT environment variable. */ -static char *posixly_correct; - -#include -#define my_index strchr - -/* Handle permutation of arguments. */ - -/* Describe the part of ARGV that contains non-options that have - been skipped. `first_nonopt' is the index in ARGV of the first of them; - `last_nonopt' is the index after the last of them. */ - -static int first_nonopt; -static int last_nonopt; - -/* Exchange two adjacent subsequences of ARGV. - One subsequence is elements [first_nonopt,last_nonopt) - which contains all the non-options that have been skipped so far. - The other is elements [last_nonopt,optind), which contains all - the options processed since those non-options were skipped. - - `first_nonopt' and `last_nonopt' are relocated so that they describe - the new indices of the non-options in ARGV after they are moved. */ - -static void -exchange (argv) - char **argv; -{ - int bottom = first_nonopt; - int middle = last_nonopt; - int top = optind; - char *tem; - - /* Exchange the shorter segment with the far end of the longer segment. - That puts the shorter segment into the right place. - It leaves the longer segment in the right place overall, - but it consists of two parts that need to be swapped next. */ - - while (top > middle && middle > bottom) - { - if (top - middle > middle - bottom) - { - /* Bottom segment is the short one. */ - int len = middle - bottom; - register int i; - - /* Swap it with the top part of the top segment. */ - for (i = 0; i < len; i++) - { - tem = argv[bottom + i]; - argv[bottom + i] = argv[top - (middle - bottom) + i]; - argv[top - (middle - bottom) + i] = tem; - } - /* Exclude the moved bottom segment from further swapping. */ - top -= len; - } - else - { - /* Top segment is the short one. */ - int len = top - middle; - register int i; - - /* Swap it with the bottom part of the bottom segment. */ - for (i = 0; i < len; i++) - { - tem = argv[bottom + i]; - argv[bottom + i] = argv[middle + i]; - argv[middle + i] = tem; - } - /* Exclude the moved top segment from further swapping. */ - bottom += len; - } - } - - /* Update records for the slots the non-options now occupy. */ - - first_nonopt += (optind - last_nonopt); - last_nonopt = optind; -} - -/* Initialize the internal data when the first call is made. */ - -static const char * -_getopt_initialize (optstring) - const char *optstring; -{ - /* Start processing options with ARGV-element 1 (since ARGV-element 0 - is the program name); the sequence of previously skipped - non-option ARGV-elements is empty. */ - - first_nonopt = last_nonopt = optind = 1; - - nextchar = NULL; - - posixly_correct = getenv ("POSIXLY_CORRECT"); - - /* Determine how to handle the ordering of options and nonoptions. */ - - if (optstring[0] == '-') - { - ordering = RETURN_IN_ORDER; - ++optstring; - } - else if (optstring[0] == '+') - { - ordering = REQUIRE_ORDER; - ++optstring; - } - else if (posixly_correct != NULL) - ordering = REQUIRE_ORDER; - else - ordering = PERMUTE; - - return optstring; -} - -/* Scan elements of ARGV (whose length is ARGC) for option characters - given in OPTSTRING. - - If an element of ARGV starts with '-', and is not exactly "-" or "--", - then it is an option element. The characters of this element - (aside from the initial '-') are option characters. If `getopt' - is called repeatedly, it returns successively each of the option characters - from each of the option elements. - - If `getopt' finds another option character, it returns that character, - updating `optind' and `nextchar' so that the next call to `getopt' can - resume the scan with the following option character or ARGV-element. - - If there are no more option characters, `getopt' returns `EOF'. - Then `optind' is the index in ARGV of the first ARGV-element - that is not an option. (The ARGV-elements have been permuted - so that those that are not options now come last.) - - OPTSTRING is a string containing the legitimate option characters. - If an option character is seen that is not listed in OPTSTRING, - return '?' after printing an error message. If you set `opterr' to - zero, the error message is suppressed but we still return '?'. - - If a char in OPTSTRING is followed by a colon, that means it wants an arg, - so the following text in the same ARGV-element, or the text of the following - ARGV-element, is returned in `optarg'. Two colons mean an option that - wants an optional arg; if there is text in the current ARGV-element, - it is returned in `optarg', otherwise `optarg' is set to zero. - - If OPTSTRING starts with `-' or `+', it requests different methods of - handling the non-option ARGV-elements. - See the comments about RETURN_IN_ORDER and REQUIRE_ORDER, above. - - Long-named options begin with `--' instead of `-'. - Their names may be abbreviated as long as the abbreviation is unique - or is an exact match for some defined option. If they have an - argument, it follows the option name in the same ARGV-element, separated - from the option name by a `=', or else the in next ARGV-element. - When `getopt' finds a long-named option, it returns 0 if that option's - `flag' field is nonzero, the value of the option's `val' field - if the `flag' field is zero. - - The elements of ARGV aren't really const, because we permute them. - But we pretend they're const in the prototype to be compatible - with other systems. - - LONGOPTS is a vector of `struct option' terminated by an - element containing a name which is zero. - - LONGIND returns the index in LONGOPT of the long-named option found. - It is only valid when a long-named option has been found by the most - recent call. - - If LONG_ONLY is nonzero, '-' as well as '--' can introduce - long-named options. */ - -int -_getopt_internal (argc, argv, optstring, longopts, longind, long_only) - int argc; - char *const *argv; - const char *optstring; - const struct option *longopts; - int *longind; - int long_only; -{ - optarg = NULL; - - if (optind == 0) - { - optstring = _getopt_initialize (optstring); - optind = 1; /* Don't scan ARGV[0], the program name. */ - } - - if (nextchar == NULL || *nextchar == '\0') - { - /* Advance to the next ARGV-element. */ - - if (ordering == PERMUTE) - { - /* If we have just processed some options following some non-options, - exchange them so that the options come first. */ - - if (first_nonopt != last_nonopt && last_nonopt != optind) - exchange ((char **) argv); - else if (last_nonopt != optind) - first_nonopt = optind; - - /* Skip any additional non-options - and extend the range of non-options previously skipped. */ - - while (optind < argc - && (argv[optind][0] != '-' || argv[optind][1] == '\0')) - optind++; - last_nonopt = optind; - } - - /* The special ARGV-element `--' means premature end of options. - Skip it like a null option, - then exchange with previous non-options as if it were an option, - then skip everything else like a non-option. */ - - if (optind != argc && !strcmp (argv[optind], "--")) - { - optind++; - - if (first_nonopt != last_nonopt && last_nonopt != optind) - exchange ((char **) argv); - else if (first_nonopt == last_nonopt) - first_nonopt = optind; - last_nonopt = argc; - - optind = argc; - } - - /* If we have done all the ARGV-elements, stop the scan - and back over any non-options that we skipped and permuted. */ - - if (optind == argc) - { - /* Set the next-arg-index to point at the non-options - that we previously skipped, so the caller will digest them. */ - if (first_nonopt != last_nonopt) - optind = first_nonopt; - return EOF; - } - - /* If we have come to a non-option and did not permute it, - either stop the scan or describe it to the caller and pass it by. */ - - if ((argv[optind][0] != '-' || argv[optind][1] == '\0')) - { - if (ordering == REQUIRE_ORDER) - return EOF; - optarg = argv[optind++]; - return 1; - } - - /* We have found another option-ARGV-element. - Skip the initial punctuation. */ - - nextchar = (argv[optind] + 1 - + (longopts != NULL && argv[optind][1] == '-')); - } - - /* Decode the current option-ARGV-element. */ - - /* Check whether the ARGV-element is a long option. - - If long_only and the ARGV-element has the form "-f", where f is - a valid short option, don't consider it an abbreviated form of - a long option that starts with f. Otherwise there would be no - way to give the -f short option. - - On the other hand, if there's a long option "fubar" and - the ARGV-element is "-fu", do consider that an abbreviation of - the long option, just like "--fu", and not "-f" with arg "u". - - This distinction seems to be the most useful approach. */ - - if (longopts != NULL - && (argv[optind][1] == '-' - || (long_only && (argv[optind][2] || !my_index (optstring, argv[optind][1]))))) - { - char *nameend; - const struct option *p; - const struct option *pfound = NULL; - int exact = 0; - int ambig = 0; - int indfound =0; - int option_index; - - for (nameend = nextchar; *nameend && *nameend != '='; nameend++) - /* Do nothing. */ ; - - /* Test all long options for either exact match - or abbreviated matches. */ - for (p = longopts, option_index = 0; p->name; p++, option_index++) - if (!strncmp (p->name, nextchar, nameend - nextchar)) - { - /* AM990705: must cast to unsigned to avoid a warning in MS VC++6 */ - if ((unsigned)(nameend - nextchar) == strlen (p->name)) - { - /* Exact match found. */ - pfound = p; - indfound = option_index; - exact = 1; - break; - } - else if (pfound == NULL) - { - /* First nonexact match found. */ - pfound = p; - indfound = option_index; - } - else - /* Second or later nonexact match found. */ - ambig = 1; - } - - if (ambig && !exact) - { - if (opterr) - fprintf (stderr, gettext ("%s: option `%s' is ambiguous\n"), - argv[0], argv[optind]); - nextchar += strlen (nextchar); - optind++; - return '?'; - } - - if (pfound != NULL) - { - option_index = indfound; - optind++; - if (*nameend) - { - /* Don't test has_arg with >, because some C compilers don't - allow it to be used on enums. */ - if (pfound->has_arg) - optarg = nameend + 1; - else - { - if (opterr) { - if (argv[optind - 1][1] == '-') - /* --option */ - fprintf (stderr, - gettext ("%s: option `--%s' doesn't allow an argument\n"), - argv[0], pfound->name); - } else { - /* +option or -option */ - fprintf (stderr, - gettext ("%s: option `%c%s' doesn't allow an argument\n"), - argv[0], argv[optind - 1][0], pfound->name); - } - - nextchar += strlen (nextchar); - return '?'; - } - } - else if (pfound->has_arg == 1) - { - if (optind < argc) - optarg = argv[optind++]; - else - { - if (opterr) - fprintf (stderr, - gettext ("%s: option `%s' requires an argument\n"), - argv[0], argv[optind - 1]); - nextchar += strlen (nextchar); - return optstring[0] == ':' ? ':' : '?'; - } - } - nextchar += strlen (nextchar); - if (longind != NULL) - *longind = option_index; - if (pfound->flag) - { - *(pfound->flag) = pfound->val; - return 0; - } - return pfound->val; - } - - /* Can't find it as a long option. If this is not getopt_long_only, - or the option starts with '--' or is not a valid short - option, then it's an error. - Otherwise interpret it as a short option. */ - if (!long_only || argv[optind][1] == '-' - || my_index (optstring, *nextchar) == NULL) - { - if (opterr) - { - if (argv[optind][1] == '-') - /* --option */ - fprintf (stderr, gettext ("%s: unrecognized option `--%s'\n"), - argv[0], nextchar); - else - /* +option or -option */ - fprintf (stderr, gettext ("%s: unrecognized option `%c%s'\n"), - argv[0], argv[optind][0], nextchar); - } - nextchar = (char *) ""; - optind++; - return '?'; - } - } - - /* Look at and handle the next short option-character. */ - - { - char c = *nextchar++; - char *temp = my_index (optstring, c); - - /* Increment `optind' when we start to process its last character. */ - if (*nextchar == '\0') - ++optind; - - if (temp == NULL || c == ':') - { - if (opterr) - { - if (posixly_correct) - /* 1003.2 specifies the format of this message. */ - fprintf (stderr, gettext ("%s: illegal option -- %c\n"), - argv[0], c); - else - fprintf (stderr, gettext ("%s: invalid option -- %c\n"), - argv[0], c); - } - optopt = c; - return '?'; - } - if (temp[1] == ':') - { - if (temp[2] == ':') - { - /* This is an option that accepts an argument optionally. */ - if (*nextchar != '\0') - { - optarg = nextchar; - optind++; - } - else - optarg = NULL; - nextchar = NULL; - } - else - { - /* This is an option that requires an argument. */ - if (*nextchar != '\0') - { - optarg = nextchar; - /* If we end this ARGV-element by taking the rest as an arg, - we must advance to the next element now. */ - optind++; - } - else if (optind == argc) - { - if (opterr) - { - /* 1003.2 specifies the format of this message. */ - fprintf (stderr, - gettext ("%s: option requires an argument -- %c\n"), - argv[0], c); - } - optopt = c; - if (optstring[0] == ':') - c = ':'; - else - c = '?'; - } - else - /* We already incremented `optind' once; - increment it again when taking next ARGV-elt as argument. */ - optarg = argv[optind++]; - nextchar = NULL; - } - } - return c; - } -} - -int -getopt (argc, argv, optstring) - int argc; - char *const *argv; - const char *optstring; -{ - return _getopt_internal (argc, argv, optstring, - (const struct option *) 0, - (int *) 0, - 0); -} diff -Nru dealer-20161012/getopt.h dealer-20190529+ds/getopt.h --- dealer-20161012/getopt.h 2004-01-18 21:23:49.000000000 +0000 +++ dealer-20190529+ds/getopt.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,104 +0,0 @@ -/* Declarations for getopt. - Copyright (C) 1989, 90, 91, 92, 93, 94 Free Software Foundation, Inc. - - This program is free software; you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by the - Free Software Foundation; either version 2, or (at your option) any - later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ - -#ifndef _GETOPT_H -#define _GETOPT_H 1 - -/* For communication from `getopt' to the caller. - When `getopt' finds an option that takes an argument, - the argument value is returned here. - Also, when `ordering' is RETURN_IN_ORDER, - each non-option ARGV-element is returned here. */ - -extern char *optarg; - -/* Index in ARGV of the next element to be scanned. - This is used for communication to and from the caller - and for communication between successive calls to `getopt'. - - On entry to `getopt', zero means this is the first call; initialize. - - When `getopt' returns EOF, this is the index of the first of the - non-option elements that the caller should itself scan. - - Otherwise, `optind' communicates from one call to the next - how much of ARGV has been scanned so far. */ - -extern int optind; - -/* Callers store zero here to inhibit the error message `getopt' prints - for unrecognized options. */ - -extern int opterr; - -/* Set to an option character which was unrecognized. */ - -extern int optopt; - -/* Describe the long-named options requested by the application. - The LONG_OPTIONS argument to getopt_long or getopt_long_only is a vector - of `struct option' terminated by an element containing a name which is - zero. - - The field `has_arg' is: - no_argument (or 0) if the option does not take an argument, - required_argument (or 1) if the option requires an argument, - optional_argument (or 2) if the option takes an optional argument. - - If the field `flag' is not NULL, it points to a variable that is set - to the value given in the field `val' when the option is found, but - left unchanged if the option is not found. - - To have a long-named option do something other than set an `int' to - a compiled-in constant, such as set a value from `optarg', set the - option's `flag' field to zero and its `val' field to a nonzero - value (the equivalent single-letter option character, if there is - one). For long options that have a zero `flag' field, `getopt' - returns the contents of the `val' field. */ - -struct option -{ - const char *name; - int has_arg; - int *flag; - int val; -}; - -/* Names for the values of the `has_arg' field of `struct option'. */ - -#define no_argument 0 -#define required_argument 1 -#define optional_argument 2 - -/* Many other libraries have conflicting prototypes for getopt, with - differences in the consts, in stdlib.h. To avoid compilation - errors, only prototype getopt for the GNU C library. */ -extern int getopt (int argc, char *const *argv, const char *shortopts); -extern int getopt_long (int argc, char *const *argv, const char *shortopts, - const struct option *longopts, int *longind); -extern int getopt_long_only (int argc, char *const *argv, - const char *shortopts, - const struct option *longopts, int *longind); - -/* Internal only. Users should not call this directly. */ -extern int _getopt_internal (int argc, char *const *argv, - const char *shortopts, - const struct option *longopts, int *longind, - int long_only); - - -#endif /* _GETOPT_H */ diff -Nru dealer-20161012/Makefile dealer-20190529+ds/Makefile --- dealer-20161012/Makefile 2016-10-12 17:15:32.000000000 +0000 +++ dealer-20190529+ds/Makefile 2019-05-29 15:34:14.000000000 +0000 @@ -10,24 +10,22 @@ TARFILE = ${PROGRAM}.tar GZIPFILE = ${PROGRAM}.tar.gz -SRC = dealer.c pbn.c c4.c getopt.c pointcount.c +SRC = dealer.c pbn.c c4.c getopt.c pointcount.c __random.c rand.c srand.c LSRC = scan.l YSRC = defs.y HDR = dealer.h tree.h -OBJ = dealer.o defs.o pbn.o c4.o getopt.o pointcount.o +OBJ = dealer.o defs.o pbn.o c4.o getopt.o pointcount.o __random.o rand.o srand.o LOBJ = scan.c YOBJ = defs.c dealer: ${OBJ} ${LOBJ} ${YOBJ} - ${MAKE} -C Random lib - $(CC) -o $@ ${OBJ} -L./Random -lgnurand - + $(CC) -o $@ ${OBJ} + clean: rm -f ${OBJ} ${LOBJ} ${YOBJ} ${MAKE} -C Examples clean - ${MAKE} -C Random clean tarclean: clean ${YOBJ} rm -f ${PROGRAM} diff -Nru dealer-20161012/Manual/input.html dealer-20190529+ds/Manual/input.html --- dealer-20161012/Manual/input.html 2004-01-18 21:23:47.000000000 +0000 +++ dealer-20190529+ds/Manual/input.html 2016-10-14 13:57:31.000000000 +0000 @@ -333,7 +333,8 @@ This operator is one of the most important in the program and is very efficiently implemented. Any shape() call, no matter how complicated is executed in constant time. Use shape() - for all length expressions if you can. + for all length expressions if you can. There is a maximum of 32 shape() + commands in an input file.
  • hascard ( (compass), (card) ), eg hascard(east, TC)
    whether east holds the 10 (T) of clubs diff -Nru dealer-20161012/MSDOS/cygtest.bat dealer-20190529+ds/MSDOS/cygtest.bat --- dealer-20161012/MSDOS/cygtest.bat 2004-01-18 21:23:48.000000000 +0000 +++ dealer-20190529+ds/MSDOS/cygtest.bat 1970-01-01 00:00:00.000000000 +0000 @@ -1,16 +0,0 @@ - -@echo off - -rem This file assumes that the main executable is one dir higher - -echo Test Results log -echo . -echo Creating test log file for RELEASE? CYGWIN code -echo Ideally this will be part of a redirected output file -echo . -echo This may take a while! -echo . - -for %%A in (Descr*.*) do ..\dealer %%A - - diff -Nru dealer-20161012/MSDOS/ddostest.bat dealer-20190529+ds/MSDOS/ddostest.bat --- dealer-20161012/MSDOS/ddostest.bat 2004-01-18 21:23:48.000000000 +0000 +++ dealer-20190529+ds/MSDOS/ddostest.bat 1970-01-01 00:00:00.000000000 +0000 @@ -1,16 +0,0 @@ - -@echo off - -rem This file assumes that the main executable is one dir higher - -echo Test Results log -echo . -echo Creating test log file for DEBUG DOS code -echo Ideally this will be part of a redirected output file -echo . -echo This may take a while! -echo . - -for %%A in (Descr*.*) do ..\mddealer %%A - - diff -Nru dealer-20161012/MSDOS/dostest.bat dealer-20190529+ds/MSDOS/dostest.bat --- dealer-20161012/MSDOS/dostest.bat 2004-01-18 21:23:48.000000000 +0000 +++ dealer-20190529+ds/MSDOS/dostest.bat 1970-01-01 00:00:00.000000000 +0000 @@ -1,16 +0,0 @@ - -@echo off - -rem This file assumes that the main executable is one dir higher - -echo Test Results log -echo . -echo Creating test log file for RELEASE DOS code -echo Ideally this will be part of a redirected output file -echo . -echo This may take a while! -echo . - -for %%A in (Descr*.*) do ..\mdealer %%A - - diff -Nru dealer-20161012/MSDOS/Makefile-MSDOS dealer-20190529+ds/MSDOS/Makefile-MSDOS --- dealer-20161012/MSDOS/Makefile-MSDOS 2004-01-18 21:23:49.000000000 +0000 +++ dealer-20190529+ds/MSDOS/Makefile-MSDOS 1970-01-01 00:00:00.000000000 +0000 @@ -1,71 +0,0 @@ -# $Header: /home/henk/CVS/dealer/MSDOS/Makefile-MSDOS,v 1.2 1999/07/03 19:59:56 henk Exp $ - -CC = gcc -CFLAGS = -Wall -pedantic -O2 -I. -DNDEBUG -DMSDOS -c -FLEX = flex -YACC = yacc - -PROGRAM = dealer -TARFILE = ${PROGRAM}.tar -GZIPFILE = ${PROGRAM}.tar.gz - -SRC = dealer.c pbn.c c4.c getopt.c pointcount.c -LSRC = scan.l -YSRC = defs.y -HDR = dealer.h tree.h - -OBJ = dealer.o defs.o pbn.o c4.o getopt.o pointcount.o -LOBJ = scan.c -YOBJ = defs.c - - -dealer: ${OBJ} ${LOBJ} ${YOBJ} - ${MAKE} -C Random lib - $(CC) -o $@ ${OBJ} -L./Random -lgnurand - -clean: - rm -f ${OBJ} - ${MAKE} -C Examples clean - ${MAKE} -C Random clean - -tarclean: clean - rm -f dealer - rm -f ${TARFILE} ${GZIPFILE} - -tarfile: tarclean - cd .. ; \ - tar cvf ${TARFILE} ${PROGRAM} --exclude CVS --exclude ${TARFILE}; \ - mv ${TARFILE} ${PROGRAM} - gzip -f ${TARFILE} - -test: dealer - ${MAKE} -C Examples test - -# -# Lex -# -.l.c: - ${FLEX} -t $< >$@ - -# -# Yacc -# -.y.c: - ${YACC} $< - mv -f y.tab.c $@ - -# -# C-code -# -.c.o: - ${CC} ${CFLAGS} -o $@ $< - -# -# File dependencies -# -scan.c: scan.l -defs.c: scan.c defs.y -dealer.o: tree.h scan.l dealer.h defs.c scan.c -pbn.o: tree.h scan.l dealer.h -defs.o: tree.h -c4.o: c4.c c4.h diff -Nru dealer-20161012/MSDOS/README dealer-20190529+ds/MSDOS/README --- dealer-20161012/MSDOS/README 2004-01-18 21:23:49.000000000 +0000 +++ dealer-20190529+ds/MSDOS/README 1970-01-01 00:00:00.000000000 +0000 @@ -1,32 +0,0 @@ - -This directory contains bits and pieces needed to compile the program under -MSVC 5.x and 6.x, submitted by Paul Baxter. - -I have not tested this stuff, as I don't have access to a machine with MSVC. - -Henk Uijterwaal ------------------------------------------------------------------------------ - -Files in this area. - -Makefile-MSDOS A makefile for MSDOS, replace the makefile in the - top level directory by this one to compile under - MSDOS - -cygtest.bat Shell-scripts to run the program under DOS. -ddostest.bat -dostest.bat - -readme_mods.txt A file describing the changes for MSVC, by - Paul Baxter. - -VC++5_project_files.zip MSVC project files for VC++ version 5. -VC++6_project_files.zip MSVC project files for VC++ version 6. - - Unzip the file for the version of VC++ that you are - using, in order to create: - - * dealer.dsp - * dealer.dsw - * dealer.opt - diff -Nru dealer-20161012/MSDOS/readme_mods.txt dealer-20190529+ds/MSDOS/readme_mods.txt --- dealer-20161012/MSDOS/readme_mods.txt 2004-01-18 21:23:49.000000000 +0000 +++ dealer-20190529+ds/MSDOS/readme_mods.txt 1970-01-01 00:00:00.000000000 +0000 @@ -1,104 +0,0 @@ -From: Paul Baxter - -email: paje@globalnet.co.uk - - -PURPOSE - -Put together a few batch files for the various versions I have. - -dealer.exe - cygwin release version Use cygwin.bat -mdealer.exe - MSDOS release version Use dostest.bat -mddealer.exe - MSDOS debug version Use ddostest.bat - -Copy any of the Descr.* example files into this (MSDOS) directory. -The batch files will run through each Descr.* file in turn. - -I thought this would be a crude initial step towards ensuring -new versions produce same results as old, or that different computer -systems produce similar results. - -Maybe use this test dir with examples and appropriate results to 'validate' -new versions. - -I would prefer that the tests were in a separate dir to the MSVC project files -but that's up to Henk. When I refer to the 'test' dir it is currently -dealer/MSDOS dir - - - -USAGE - -For the dos programs I have batch files dostest and ddostest (extra d for debug) -Similarly for cygtest - - Put any Descr*.* input files in the test dir - - cd to it - -FROM DOS PROMPT - -type: - - dostest - -to run all files through mdealer (o/p to stdout) - -or type: - - command.com /c dostest >file.log - -to redirect to a file. (Output will not be visible) -(Have to use a new dos shell in order to redirect the output of a batch file) - -similarly use 'ddostest' instead of 'dostest' to exercise the debug DOS version - - -These batch files assume executables are one dir higher than test dir -If you have put the executables on your Path or have renamed the files -edit the batch files as appropriate - - -Also try with cygtest (must have cygwin dll in path etc.) - - cygtest - -Results of the three log files appear similar in probabilities etc. -So maybe the Dos version can give your analysis a 30% boost in performance! - - -FROM CYGWIN SHELL PROMPT - -Will need to explicitly add .bat and possibly begin command with ./ -to indicate the file is in current dir - -type: - - ./dostest.bat -or - command.com /c dostest.bat >file.log - -PROBLEMS - -See my notes in main dir regarding problem with Descr.Stayman in -debug version - -SPEED COMPARISON - -Release DOS executable seems about ~50-80% faster than Cygwin ver -Debug DOS is about 50% slower than Cygwin -Mileage may vary - -(Descr.blue_team modified to run a bit longer) - -Times: 12 sec on Win release - 20 sec on Cygwin - 30 sec on Win debug - -CONCLUSIONS - -It would be useful to collect a few simulation files to do the following: - -1) Exercise all features of dealer -2) Generate some standard sims where results are known. Can check that dealer - gets the answers right. Binary files /tmp/tmp7YciDH/xMey2eIeWI/dealer-20161012/MSDOS/VC++5_project_files.zip and /tmp/tmp7YciDH/NmPkdkPF55/dealer-20190529+ds/MSDOS/VC++5_project_files.zip differ Binary files /tmp/tmp7YciDH/xMey2eIeWI/dealer-20161012/MSDOS/VC++6_project_files.zip and /tmp/tmp7YciDH/NmPkdkPF55/dealer-20190529+ds/MSDOS/VC++6_project_files.zip differ diff -Nru dealer-20161012/patch dealer-20190529+ds/patch --- dealer-20161012/patch 1970-01-01 00:00:00.000000000 +0000 +++ dealer-20190529+ds/patch 2019-05-29 13:46:00.000000000 +0000 @@ -0,0 +1,30 @@ +Mask k so zero52[k] doesn't overflow + +--- a/dealer.c ++++ b/dealer.c +@@ -51,6 +51,7 @@ + #define DEFAULT_MODE STAT_MODE + #define RANDBITS 16 + #define NRANDVALS (1<> (31 - RANDBITS)); + #endif /* STD_RAND */ +- j = zero52[k]; ++ j = zero52[k & NRANDMASK]; + } while (j == 0xFF); + } while (stacked_pack[j] != NO_CARD); + +@@ -1621,7 +1622,7 @@ + } + } + if (argc - optind > 2 || errflg) { +- fprintf (stderr, "Usage: %s [-emvu] [-s seed] [-p num] [-v num] [inputfile]\n", argv[0]); ++ fprintf (stderr, "Usage: %s [-023ehuvmqV] [-p n] [-g n] [-s seed] [-l n] [inputfile]\n", argv[0]); + exit (-1); + } + if (optind < argc && freopen (input_file = argv[optind], "r", stdin) == NULL) { diff -Nru dealer-20161012/rand.c dealer-20190529+ds/rand.c --- dealer-20161012/rand.c 1970-01-01 00:00:00.000000000 +0000 +++ dealer-20190529+ds/rand.c 2004-01-18 21:23:47.000000000 +0000 @@ -0,0 +1,46 @@ +/* + This code has been introduced by Bruce Moore +*/ + +/* Copyright (C) 1991 Free Software Foundation, Inc. +This file is part of the GNU C Library. + +The GNU C Library is free software; you can redistribute it and/or +modify it under the terms of the GNU Library General Public License as +published by the Free Software Foundation; either version 2 of the +License, or (at your option) any later version. + +The GNU C Library is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +Library General Public License for more details. + +You should have received a copy of the GNU Library General Public +License along with the GNU C Library; see the file COPYING.LIB. If +not, write to the Free Software Foundation, Inc., 675 Mass Ave, +Cambridge, MA 02139, USA. */ + +#include "ansidecl.h" +/* +#include +*/ + +#undef rand +#undef __random + +long int DEFUN_VOID(__random); + + +/* Return a random integer between 0 and RAND_MAX. */ +/* int +DEFUN_VOID(gnurand) +{ + return (int) __random(); +} +*/ + + +int gnurand () { + return (int) __random(); } + + diff -Nru dealer-20161012/Random/ansidecl.h dealer-20190529+ds/Random/ansidecl.h --- dealer-20161012/Random/ansidecl.h 2004-01-18 21:23:47.000000000 +0000 +++ dealer-20190529+ds/Random/ansidecl.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,108 +0,0 @@ -/* Copyright (C) 1991 Free Software Foundation, Inc. -This file is part of the GNU C Library. - -The GNU C Library is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 1, or (at your option) -any later version. - -The GNU C Library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with the GNU C Library; see the file COPYING. If not, write to -the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ - -/* ANSI and traditional C compatibility macros - - ANSI C is assumed if __STDC__ is #defined. - - Macro ANSI C definition Traditional C definition - ----- ---- - ---------- ----------- - ---------- - PTR `void *' `char *' - LONG_DOUBLE `long double' `double' - CONST `const' `' - VOLATILE `volatile' `' - SIGNED `signed' `' - PTRCONST `void *const' `char *' - - DEFUN(name, arglist, args) - - Defines function NAME. - - ARGLIST lists the arguments, separated by commas and enclosed in - parentheses. ARGLIST becomes the argument list in traditional C. - - ARGS list the arguments with their types. It becomes a prototype in - ANSI C, and the type declarations in traditional C. Arguments should - be separated with `AND'. For functions with a variable number of - arguments, the last thing listed should be `DOTS'. - - DEFUN_VOID(name) - - Defines a function NAME, which takes no arguments. - - EXFUN(name, prototype) - - Is used in an external function declaration. - In ANSI C it is `NAMEPROTOTYPE' (so PROTOTYPE should be enclosed in - parentheses). In traditional C it is `NAME()'. - For a function that takes no arguments, PROTOTYPE should be `(NOARGS)'. - - For example: - extern int EXFUN(printf, (CONST char *format DOTS)); - int DEFUN(fprintf, (stream, format), - FILE *stream AND CONST char *format DOTS) { ... } - void DEFUN_VOID(abort) { ... } -*/ - -#ifndef _ANSIDECL_H - -#define _ANSIDECL_H 1 - - -/* Every source file includes this file, - so they will all get the switch for lint. */ -/* LINTLIBRARY */ - - -#ifdef __STDC__ - -#define PTR void * -#define PTRCONST void *CONST -#define LONG_DOUBLE long double - -#define AND , -#define NOARGS void -#define CONST const -#define VOLATILE volatile -#define SIGNED signed -#define DOTS , ... - -#define EXFUN(name, proto) name proto -#define DEFUN(name, arglist, args) name(args) -#define DEFUN_VOID(name) name(NOARGS) - -#else /* Not ANSI C. */ - -#define PTR char * -#define PTRCONST PTR -#define LONG_DOUBLE double - -#define AND ; -#define NOARGS -#define CONST -#define VOLATILE -#define SIGNED -#define DOTS - -#define EXFUN(name, proto) name() -#define DEFUN(name, arglist, args) name arglist args; -#define DEFUN_VOID(name) name() - -#endif /* ANSI C. */ - - -#endif /* ansidecl.h */ diff -Nru dealer-20161012/Random/.cvsignore dealer-20190529+ds/Random/.cvsignore --- dealer-20161012/Random/.cvsignore 2004-01-18 21:23:47.000000000 +0000 +++ dealer-20190529+ds/Random/.cvsignore 1970-01-01 00:00:00.000000000 +0000 @@ -1,2 +0,0 @@ -*.o -*.a diff -Nru dealer-20161012/Random/GPL dealer-20190529+ds/Random/GPL --- dealer-20161012/Random/GPL 2004-01-18 21:23:47.000000000 +0000 +++ dealer-20190529+ds/Random/GPL 1970-01-01 00:00:00.000000000 +0000 @@ -1,339 +0,0 @@ - GNU GENERAL PUBLIC LICENSE - Version 2, June 1991 - - Copyright (C) 1989, 1991 Free Software Foundation, Inc. - 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -License is intended to guarantee your freedom to share and change free -software--to make sure the software is free for all its users. This -General Public License applies to most of the Free Software -Foundation's software and to any other program whose authors commit to -using it. (Some other Free Software Foundation software is covered by -the GNU Library General Public License instead.) You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -this service if you wish), that you receive source code or can get it -if you want it, that you can change the software or use pieces of it -in new free programs; and that you know you can do these things. - - To protect your rights, we need to make restrictions that forbid -anyone to deny you these rights or to ask you to surrender the rights. -These restrictions translate to certain responsibilities for you if you -distribute copies of the software, or if you modify it. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must give the recipients all the rights that -you have. You must make sure that they, too, receive or can get the -source code. And you must show them these terms so they know their -rights. - - We protect your rights with two steps: (1) copyright the software, and -(2) offer you this license which gives you legal permission to copy, -distribute and/or modify the software. - - Also, for each author's protection and ours, we want to make certain -that everyone understands that there is no warranty for this free -software. If the software is modified by someone else and passed on, we -want its recipients to know that what they have is not the original, so -that any problems introduced by others will not reflect on the original -authors' reputations. - - Finally, any free program is threatened constantly by software -patents. We wish to avoid the danger that redistributors of a free -program will individually obtain patent licenses, in effect making the -program proprietary. To prevent this, we have made it clear that any -patent must be licensed for everyone's free use or not licensed at all. - - The precise terms and conditions for copying, distribution and -modification follow. - - GNU GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License applies to any program or other work which contains -a notice placed by the copyright holder saying it may be distributed -under the terms of this General Public License. The "Program", below, -refers to any such program or work, and a "work based on the Program" -means either the Program or any derivative work under copyright law: -that is to say, a work containing the Program or a portion of it, -either verbatim or with modifications and/or translated into another -language. (Hereinafter, translation is included without limitation in -the term "modification".) Each licensee is addressed as "you". - -Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running the Program is not restricted, and the output from the Program -is covered only if its contents constitute a work based on the -Program (independent of having been made by running the Program). -Whether that is true depends on what the Program does. - - 1. You may copy and distribute verbatim copies of the Program's -source code as you receive it, in any medium, provided that you -conspicuously and appropriately publish on each copy an appropriate -copyright notice and disclaimer of warranty; keep intact all the -notices that refer to this License and to the absence of any warranty; -and give any other recipients of the Program a copy of this License -along with the Program. - -You may charge a fee for the physical act of transferring a copy, and -you may at your option offer warranty protection in exchange for a fee. - - 2. You may modify your copy or copies of the Program or any portion -of it, thus forming a work based on the Program, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) You must cause the modified files to carry prominent notices - stating that you changed the files and the date of any change. - - b) You must cause any work that you distribute or publish, that in - whole or in part contains or is derived from the Program or any - part thereof, to be licensed as a whole at no charge to all third - parties under the terms of this License. - - c) If the modified program normally reads commands interactively - when run, you must cause it, when started running for such - interactive use in the most ordinary way, to print or display an - announcement including an appropriate copyright notice and a - notice that there is no warranty (or else, saying that you provide - a warranty) and that users may redistribute the program under - these conditions, and telling the user how to view a copy of this - License. (Exception: if the Program itself is interactive but - does not normally print such an announcement, your work based on - the Program is not required to print an announcement.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Program, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Program, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Program. - -In addition, mere aggregation of another work not based on the Program -with the Program (or with a work based on the Program) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may copy and distribute the Program (or a work based on it, -under Section 2) in object code or executable form under the terms of -Sections 1 and 2 above provided that you also do one of the following: - - a) Accompany it with the complete corresponding machine-readable - source code, which must be distributed under the terms of Sections - 1 and 2 above on a medium customarily used for software interchange; or, - - b) Accompany it with a written offer, valid for at least three - years, to give any third party, for a charge no more than your - cost of physically performing source distribution, a complete - machine-readable copy of the corresponding source code, to be - distributed under the terms of Sections 1 and 2 above on a medium - customarily used for software interchange; or, - - c) Accompany it with the information you received as to the offer - to distribute corresponding source code. (This alternative is - allowed only for noncommercial distribution and only if you - received the program in object code or executable form with such - an offer, in accord with Subsection b above.) - -The source code for a work means the preferred form of the work for -making modifications to it. For an executable work, complete source -code means all the source code for all modules it contains, plus any -associated interface definition files, plus the scripts used to -control compilation and installation of the executable. However, as a -special exception, the source code distributed need not include -anything that is normally distributed (in either source or binary -form) with the major components (compiler, kernel, and so on) of the -operating system on which the executable runs, unless that component -itself accompanies the executable. - -If distribution of executable or object code is made by offering -access to copy from a designated place, then offering equivalent -access to copy the source code from the same place counts as -distribution of the source code, even though third parties are not -compelled to copy the source along with the object code. - - 4. You may not copy, modify, sublicense, or distribute the Program -except as expressly provided under this License. Any attempt -otherwise to copy, modify, sublicense or distribute the Program is -void, and will automatically terminate your rights under this License. -However, parties who have received copies, or rights, from you under -this License will not have their licenses terminated so long as such -parties remain in full compliance. - - 5. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Program or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Program (or any work based on the -Program), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Program or works based on it. - - 6. Each time you redistribute the Program (or any work based on the -Program), the recipient automatically receives a license from the -original licensor to copy, distribute or modify the Program subject to -these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties to -this License. - - 7. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Program at all. For example, if a patent -license would not permit royalty-free redistribution of the Program by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Program. - -If any portion of this section is held invalid or unenforceable under -any particular circumstance, the balance of the section is intended to -apply and the section as a whole is intended to apply in other -circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system, which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 8. If the distribution and/or use of the Program is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Program under this License -may add an explicit geographical distribution limitation excluding -those countries, so that distribution is permitted only in or among -countries not thus excluded. In such case, this License incorporates -the limitation as if written in the body of this License. - - 9. The Free Software Foundation may publish revised and/or new versions -of the General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - -Each version is given a distinguishing version number. If the Program -specifies a version number of this License which applies to it and "any -later version", you have the option of following the terms and conditions -either of that version or of any later version published by the Free -Software Foundation. If the Program does not specify a version number of -this License, you may choose any version ever published by the Free Software -Foundation. - - 10. If you wish to incorporate parts of the Program into other free -programs whose distribution conditions are different, write to the author -to ask for permission. For software which is copyrighted by the Free -Software Foundation, write to the Free Software Foundation; we sometimes -make exceptions for this. Our decision will be guided by the two goals -of preserving the free status of all derivatives of our free software and -of promoting the sharing and reuse of software generally. - - NO WARRANTY - - 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY -FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN -OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES -PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED -OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS -TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE -PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, -REPAIR OR CORRECTION. - - 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR -REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, -INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING -OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED -TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY -YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER -PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE -POSSIBILITY OF SUCH DAMAGES. - - END OF TERMS AND CONDITIONS - - Appendix: How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -convey the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - - Copyright (C) 19yy - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - -Also add information on how to contact you by electronic and paper mail. - -If the program is interactive, make it output a short notice like this -when it starts in an interactive mode: - - Gnomovision version 69, Copyright (C) 19yy name of author - Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, the commands you use may -be called something other than `show w' and `show c'; they could even be -mouse-clicks or menu items--whatever suits your program. - -You should also get your employer (if you work as a programmer) or your -school, if any, to sign a "copyright disclaimer" for the program, if -necessary. Here is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the program - `Gnomovision' (which makes passes at compilers) written by James Hacker. - - , 1 April 1989 - Ty Coon, President of Vice - -This General Public License does not permit incorporating your program into -proprietary programs. If your program is a subroutine library, you may -consider it more useful to permit linking proprietary applications with the -library. If this is what you want to do, use the GNU Library General -Public License instead of this License. diff -Nru dealer-20161012/Random/GPL.lib dealer-20190529+ds/Random/GPL.lib --- dealer-20161012/Random/GPL.lib 2004-01-18 21:23:47.000000000 +0000 +++ dealer-20190529+ds/Random/GPL.lib 1970-01-01 00:00:00.000000000 +0000 @@ -1,482 +0,0 @@ - GNU LIBRARY GENERAL PUBLIC LICENSE - Version 2, June 1991 - - Copyright (C) 1991 Free Software Foundation, Inc. - 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - -[This is the first released version of the library GPL. It is - numbered 2 because it goes with version 2 of the ordinary GPL.] - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -Licenses are intended to guarantee your freedom to share and change -free software--to make sure the software is free for all its users. - - This license, the Library General Public License, applies to some -specially designated Free Software Foundation software, and to any -other libraries whose authors decide to use it. You can use it for -your libraries, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -this service if you wish), that you receive source code or can get it -if you want it, that you can change the software or use pieces of it -in new free programs; and that you know you can do these things. - - To protect your rights, we need to make restrictions that forbid -anyone to deny you these rights or to ask you to surrender the rights. -These restrictions translate to certain responsibilities for you if -you distribute copies of the library, or if you modify it. - - For example, if you distribute copies of the library, whether gratis -or for a fee, you must give the recipients all the rights that we gave -you. You must make sure that they, too, receive or can get the source -code. If you link a program with the library, you must provide -complete object files to the recipients so that they can relink them -with the library, after making changes to the library and recompiling -it. And you must show them these terms so they know their rights. - - Our method of protecting your rights has two steps: (1) copyright -the library, and (2) offer you this license which gives you legal -permission to copy, distribute and/or modify the library. - - Also, for each distributor's protection, we want to make certain -that everyone understands that there is no warranty for this free -library. If the library is modified by someone else and passed on, we -want its recipients to know that what they have is not the original -version, so that any problems introduced by others will not reflect on -the original authors' reputations. - - Finally, any free program is threatened constantly by software -patents. We wish to avoid the danger that companies distributing free -software will individually obtain patent licenses, thus in effect -transforming the program into proprietary software. To prevent this, -we have made it clear that any patent must be licensed for everyone's -free use or not licensed at all. - - Most GNU software, including some libraries, is covered by the ordinary -GNU General Public License, which was designed for utility programs. This -license, the GNU Library General Public License, applies to certain -designated libraries. This license is quite different from the ordinary -one; be sure to read it in full, and don't assume that anything in it is -the same as in the ordinary license. - - The reason we have a separate public license for some libraries is that -they blur the distinction we usually make between modifying or adding to a -program and simply using it. Linking a program with a library, without -changing the library, is in some sense simply using the library, and is -analogous to running a utility program or application program. However, in -a textual and legal sense, the linked executable is a combined work, a -derivative of the original library, and the ordinary General Public License -treats it as such. - - Because of this blurred distinction, using the ordinary General -Public License for libraries did not effectively promote software -sharing, because most developers did not use the libraries. We -concluded that weaker conditions might promote sharing better. - - However, unrestricted linking of non-free programs would deprive the -users of those programs of all benefit from the free status of the -libraries themselves. This Library General Public License is intended to -permit developers of non-free programs to use free libraries, while -preserving your freedom as a user of such programs to change the free -libraries that are incorporated in them. (We have not seen how to achieve -this as regards changes in header files, but we have achieved it as regards -changes in the actual functions of the Library.) The hope is that this -will lead to faster development of free libraries. - - The precise terms and conditions for copying, distribution and -modification follow. Pay close attention to the difference between a -"work based on the library" and a "work that uses the library". The -former contains code derived from the library, while the latter only -works together with the library. - - Note that it is possible for a library to be covered by the ordinary -General Public License rather than by this special one. - - GNU LIBRARY GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License Agreement applies to any software library which -contains a notice placed by the copyright holder or other authorized -party saying it may be distributed under the terms of this Library -General Public License (also called "this License"). Each licensee is -addressed as "you". - - A "library" means a collection of software functions and/or data -prepared so as to be conveniently linked with application programs -(which use some of those functions and data) to form executables. - - The "Library", below, refers to any such software library or work -which has been distributed under these terms. A "work based on the -Library" means either the Library or any derivative work under -copyright law: that is to say, a work containing the Library or a -portion of it, either verbatim or with modifications and/or translated -straightforwardly into another language. (Hereinafter, translation is -included without limitation in the term "modification".) - - "Source code" for a work means the preferred form of the work for -making modifications to it. For a library, complete source code means -all the source code for all modules it contains, plus any associated -interface definition files, plus the scripts used to control compilation -and installation of the library. - - Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running a program using the Library is not restricted, and output from -such a program is covered only if its contents constitute a work based -on the Library (independent of the use of the Library in a tool for -writing it). Whether that is true depends on what the Library does -and what the program that uses the Library does. - - 1. You may copy and distribute verbatim copies of the Library's -complete source code as you receive it, in any medium, provided that -you conspicuously and appropriately publish on each copy an -appropriate copyright notice and disclaimer of warranty; keep intact -all the notices that refer to this License and to the absence of any -warranty; and distribute a copy of this License along with the -Library. - - You may charge a fee for the physical act of transferring a copy, -and you may at your option offer warranty protection in exchange for a -fee. - - 2. You may modify your copy or copies of the Library or any portion -of it, thus forming a work based on the Library, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) The modified work must itself be a software library. - - b) You must cause the files modified to carry prominent notices - stating that you changed the files and the date of any change. - - c) You must cause the whole of the work to be licensed at no - charge to all third parties under the terms of this License. - - d) If a facility in the modified Library refers to a function or a - table of data to be supplied by an application program that uses - the facility, other than as an argument passed when the facility - is invoked, then you must make a good faith effort to ensure that, - in the event an application does not supply such function or - table, the facility still operates, and performs whatever part of - its purpose remains meaningful. - - (For example, a function in a library to compute square roots has - a purpose that is entirely well-defined independent of the - application. Therefore, Subsection 2d requires that any - application-supplied function or table used by this function must - be optional: if the application does not supply it, the square - root function must still compute square roots.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Library, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Library, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote -it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Library. - -In addition, mere aggregation of another work not based on the Library -with the Library (or with a work based on the Library) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may opt to apply the terms of the ordinary GNU General Public -License instead of this License to a given copy of the Library. To do -this, you must alter all the notices that refer to this License, so -that they refer to the ordinary GNU General Public License, version 2, -instead of to this License. (If a newer version than version 2 of the -ordinary GNU General Public License has appeared, then you can specify -that version instead if you wish.) Do not make any other change in -these notices. - - Once this change is made in a given copy, it is irreversible for -that copy, so the ordinary GNU General Public License applies to all -subsequent copies and derivative works made from that copy. - - This option is useful when you wish to copy part of the code of -the Library into a program that is not a library. - - 4. You may copy and distribute the Library (or a portion or -derivative of it, under Section 2) in object code or executable form -under the terms of Sections 1 and 2 above provided that you accompany -it with the complete corresponding machine-readable source code, which -must be distributed under the terms of Sections 1 and 2 above on a -medium customarily used for software interchange. - - If distribution of object code is made by offering access to copy -from a designated place, then offering equivalent access to copy the -source code from the same place satisfies the requirement to -distribute the source code, even though third parties are not -compelled to copy the source along with the object code. - - 5. A program that contains no derivative of any portion of the -Library, but is designed to work with the Library by being compiled or -linked with it, is called a "work that uses the Library". Such a -work, in isolation, is not a derivative work of the Library, and -therefore falls outside the scope of this License. - - However, linking a "work that uses the Library" with the Library -creates an executable that is a derivative of the Library (because it -contains portions of the Library), rather than a "work that uses the -library". The executable is therefore covered by this License. -Section 6 states terms for distribution of such executables. - - When a "work that uses the Library" uses material from a header file -that is part of the Library, the object code for the work may be a -derivative work of the Library even though the source code is not. -Whether this is true is especially significant if the work can be -linked without the Library, or if the work is itself a library. The -threshold for this to be true is not precisely defined by law. - - If such an object file uses only numerical parameters, data -structure layouts and accessors, and small macros and small inline -functions (ten lines or less in length), then the use of the object -file is unrestricted, regardless of whether it is legally a derivative -work. (Executables containing this object code plus portions of the -Library will still fall under Section 6.) - - Otherwise, if the work is a derivative of the Library, you may -distribute the object code for the work under the terms of Section 6. -Any executables containing that work also fall under Section 6, -whether or not they are linked directly with the Library itself. - - 6. As an exception to the Sections above, you may also compile or -link a "work that uses the Library" with the Library to produce a -work containing portions of the Library, and distribute that work -under terms of your choice, provided that the terms permit -modification of the work for the customer's own use and reverse -engineering for debugging such modifications. - - You must give prominent notice with each copy of the work that the -Library is used in it and that the Library and its use are covered by -this License. You must supply a copy of this License. If the work -during execution displays copyright notices, you must include the -copyright notice for the Library among them, as well as a reference -directing the user to the copy of this License. Also, you must do one -of these things: - - a) Accompany the work with the complete corresponding - machine-readable source code for the Library including whatever - changes were used in the work (which must be distributed under - Sections 1 and 2 above); and, if the work is an executable linked - with the Library, with the complete machine-readable "work that - uses the Library", as object code and/or source code, so that the - user can modify the Library and then relink to produce a modified - executable containing the modified Library. (It is understood - that the user who changes the contents of definitions files in the - Library will not necessarily be able to recompile the application - to use the modified definitions.) - - b) Accompany the work with a written offer, valid for at - least three years, to give the same user the materials - specified in Subsection 6a, above, for a charge no more - than the cost of performing this distribution. - - c) If distribution of the work is made by offering access to copy - from a designated place, offer equivalent access to copy the above - specified materials from the same place. - - d) Verify that the user has already received a copy of these - materials or that you have already sent this user a copy. - - For an executable, the required form of the "work that uses the -Library" must include any data and utility programs needed for -reproducing the executable from it. However, as a special exception, -the source code distributed need not include anything that is normally -distributed (in either source or binary form) with the major -components (compiler, kernel, and so on) of the operating system on -which the executable runs, unless that component itself accompanies -the executable. - - It may happen that this requirement contradicts the license -restrictions of other proprietary libraries that do not normally -accompany the operating system. Such a contradiction means you cannot -use both them and the Library together in an executable that you -distribute. - - 7. You may place library facilities that are a work based on the -Library side-by-side in a single library together with other library -facilities not covered by this License, and distribute such a combined -library, provided that the separate distribution of the work based on -the Library and of the other library facilities is otherwise -permitted, and provided that you do these two things: - - a) Accompany the combined library with a copy of the same work - based on the Library, uncombined with any other library - facilities. This must be distributed under the terms of the - Sections above. - - b) Give prominent notice with the combined library of the fact - that part of it is a work based on the Library, and explaining - where to find the accompanying uncombined form of the same work. - - 8. You may not copy, modify, sublicense, link with, or distribute -the Library except as expressly provided under this License. Any -attempt otherwise to copy, modify, sublicense, link with, or -distribute the Library is void, and will automatically terminate your -rights under this License. However, parties who have received copies, -or rights, from you under this License will not have their licenses -terminated so long as such parties remain in full compliance. - - 9. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Library or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Library (or any work based on the -Library), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Library or works based on it. - - 10. Each time you redistribute the Library (or any work based on the -Library), the recipient automatically receives a license from the -original licensor to copy, distribute, link with or modify the Library -subject to these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties to -this License. - - 11. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Library at all. For example, if a patent -license would not permit royalty-free redistribution of the Library by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Library. - -If any portion of this section is held invalid or unenforceable under any -particular circumstance, the balance of the section is intended to apply, -and the section as a whole is intended to apply in other circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 12. If the distribution and/or use of the Library is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Library under this License may add -an explicit geographical distribution limitation excluding those countries, -so that distribution is permitted only in or among countries not thus -excluded. In such case, this License incorporates the limitation as if -written in the body of this License. - - 13. The Free Software Foundation may publish revised and/or new -versions of the Library General Public License from time to time. -Such new versions will be similar in spirit to the present version, -but may differ in detail to address new problems or concerns. - -Each version is given a distinguishing version number. If the Library -specifies a version number of this License which applies to it and -"any later version", you have the option of following the terms and -conditions either of that version or of any later version published by -the Free Software Foundation. If the Library does not specify a -license version number, you may choose any version ever published by -the Free Software Foundation. - - 14. If you wish to incorporate parts of the Library into other free -programs whose distribution conditions are incompatible with these, -write to the author to ask for permission. For software which is -copyrighted by the Free Software Foundation, write to the Free -Software Foundation; we sometimes make exceptions for this. Our -decision will be guided by the two goals of preserving the free status -of all derivatives of our free software and of promoting the sharing -and reuse of software generally. - - NO WARRANTY - - 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO -WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. -EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR -OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY -KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE -LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME -THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. - - 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN -WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY -AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU -FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR -CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE -LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING -RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A -FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF -SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH -DAMAGES. - - END OF TERMS AND CONDITIONS - - Appendix: How to Apply These Terms to Your New Libraries - - If you develop a new library, and you want it to be of the greatest -possible use to the public, we recommend making it free software that -everyone can redistribute and change. You can do so by permitting -redistribution under these terms (or, alternatively, under the terms of the -ordinary General Public License). - - To apply these terms, attach the following notices to the library. It is -safest to attach them to the start of each source file to most effectively -convey the exclusion of warranty; and each file should have at least the -"copyright" line and a pointer to where the full notice is found. - - - Copyright (C) - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with this library; if not, write to the Free - Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, - MA 02111-1307, USA - -Also add information on how to contact you by electronic and paper mail. - -You should also get your employer (if you work as a programmer) or your -school, if any, to sign a "copyright disclaimer" for the library, if -necessary. Here is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the - library `Frob' (a library for tweaking knobs) written by James Random Hacker. - - , 1 April 1990 - Ty Coon, President of Vice - -That's all there is to it! diff -Nru dealer-20161012/Random/Makefile dealer-20190529+ds/Random/Makefile --- dealer-20161012/Random/Makefile 2004-01-18 21:23:47.000000000 +0000 +++ dealer-20190529+ds/Random/Makefile 1970-01-01 00:00:00.000000000 +0000 @@ -1,31 +0,0 @@ -SRC = $(wildcard *.c) -OBJ = $(subst .c,.o,$(wildcard *.c)) -GCC = gcc -GCCFLAGS = -c -Wall -O2 -I. -HDR = ansidecl.h -LIB = libgnurand.a -AR = ar -ARFLAGS = rcs - -help: - @echo "Makefile tags:" - @echo - @echo "lib: Make ${LIB}" - @echo "clean: Remove ${OBJ}" - @echo - -lib: ${LIB} - - -clean: - -rm ${OBJ} ${LIB} - -.c.o: ${HDR} - ${GCC} ${GCCFLAGS} -o $@ $< - -${LIB}: ${OBJ} ${HDR} - ${AR} ${ARFLAGS} $@ ${OBJ} - -__random.o: ${HDR} -rand.o: ${HDR} -srand.o: ${HDR} diff -Nru dealer-20161012/Random/rand.c dealer-20190529+ds/Random/rand.c --- dealer-20161012/Random/rand.c 2004-01-18 21:23:47.000000000 +0000 +++ dealer-20190529+ds/Random/rand.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,46 +0,0 @@ -/* - This code has been introduced by Bruce Moore -*/ - -/* Copyright (C) 1991 Free Software Foundation, Inc. -This file is part of the GNU C Library. - -The GNU C Library is free software; you can redistribute it and/or -modify it under the terms of the GNU Library General Public License as -published by the Free Software Foundation; either version 2 of the -License, or (at your option) any later version. - -The GNU C Library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Library General Public License for more details. - -You should have received a copy of the GNU Library General Public -License along with the GNU C Library; see the file COPYING.LIB. If -not, write to the Free Software Foundation, Inc., 675 Mass Ave, -Cambridge, MA 02139, USA. */ - -#include "ansidecl.h" -/* -#include -*/ - -#undef rand -#undef __random - -long int DEFUN_VOID(__random); - - -/* Return a random integer between 0 and RAND_MAX. */ -/* int -DEFUN_VOID(gnurand) -{ - return (int) __random(); -} -*/ - - -int gnurand () { - return (int) __random(); } - - diff -Nru dealer-20161012/Random/__random.c dealer-20190529+ds/Random/__random.c --- dealer-20161012/Random/__random.c 2004-01-18 21:23:47.000000000 +0000 +++ dealer-20190529+ds/Random/__random.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,355 +0,0 @@ -/* - This code has been introduced by Bruce Moore -*/ - -/* - * Copyright (c) 1983 Regents of the University of California. - * All rights reserved. - * - * Redistribution and use in source and binary forms are permitted - * provided that the above copyright notice and this paragraph are - * duplicated in all such forms and that any documentation, - * advertising materials, and other materials related to such - * distribution and use acknowledge that the software was developed - * by the University of California, Berkeley. The name of the - * University may not be used to endorse or promote products derived - * from this software without specific prior written permission. - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED - * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. - */ - -/* - * This is derived from the Berkeley source: - * @(#)random.c 5.5 (Berkeley) 7/6/88 - * It was reworked for the GNU C Library by Roland McGrath. - */ - -#include "ansidecl.h" -#include -#include -#include -/* -#include -*/ - -long int DEFUN_VOID(__random); - - -/* An improved random number generation package. In addition to the standard - rand()/srand() like interface, this package also has a special state info - interface. The initstate() routine is called with a seed, an array of - bytes, and a count of how many bytes are being passed in; this array is - then initialized to contain information for random number generation with - that much state information. Good sizes for the amount of state - information are 32, 64, 128, and 256 bytes. The state can be switched by - calling the setstate() function with the same array as was initiallized - with initstate(). By default, the package runs with 128 bytes of state - information and generates far better random numbers than a linear - congruential generator. If the amount of state information is less than - 32 bytes, a simple linear congruential R.N.G. is used. Internally, the - state information is treated as an array of longs; the zeroeth element of - the array is the type of R.N.G. being used (small integer); the remainder - of the array is the state information for the R.N.G. Thus, 32 bytes of - state information will give 7 longs worth of state information, which will - allow a degree seven polynomial. (Note: The zeroeth word of state - information also has some other information stored in it; see setstate - for details). The random number generation technique is a linear feedback - shift register approach, employing trinomials (since there are fewer terms - to sum up that way). In this approach, the least significant bit of all - the numbers in the state table will act as a linear feedback shift register, - and will have period 2^deg - 1 (where deg is the degree of the polynomial - being used, assuming that the polynomial is irreducible and primitive). - The higher order bits will have longer periods, since their values are - also influenced by pseudo-random carries out of the lower bits. The - total period of the generator is approximately deg*(2**deg - 1); thus - doubling the amount of state information has a vast influence on the - period of the generator. Note: The deg*(2**deg - 1) is an approximation - only good for large deg, when the period of the shift register is the - dominant factor. With deg equal to seven, the period is actually much - longer than the 7*(2**7 - 1) predicted by this formula. */ - -/* For each of the currently supported random number generators, we have a - break value on the amount of state information (you need at least thi - bytes of state info to support this random number generator), a degree for - the polynomial (actually a trinomial) that the R.N.G. is based on, and - separation between the two lower order coefficients of the trinomial. */ - -/* Linear congruential. */ -#define TYPE_0 0 -#define BREAK_0 8 -#define DEG_0 0 -#define SEP_0 0 - -/* x**7 + x**3 + 1. */ -#define TYPE_1 1 -#define BREAK_1 32 -#define DEG_1 7 -#define SEP_1 3 - -/* x**15 + x + 1. */ -#define TYPE_2 2 -#define BREAK_2 64 -#define DEG_2 15 -#define SEP_2 1 - -/* x**31 + x**3 + 1. */ -#define TYPE_3 3 -#define BREAK_3 128 -#define DEG_3 31 -#define SEP_3 3 - -/* x**63 + x + 1. */ -#define TYPE_4 4 -#define BREAK_4 256 -#define DEG_4 63 -#define SEP_4 1 - - -/* Array versions of the above information to make code run faster. - Relies on fact that TYPE_i == i. */ - -#define MAX_TYPES 5 /* Max number of types above. */ - -static int degrees[MAX_TYPES] = { DEG_0, DEG_1, DEG_2, DEG_3, DEG_4 }; -static int seps[MAX_TYPES] = { SEP_0, SEP_1, SEP_2, SEP_3, SEP_4 }; - - - -/* Initially, everything is set up as if from: - initstate(1, randtbl, 128); - Note that this initialization takes advantage of the fact that srandom - advances the front and rear pointers 10*rand_deg times, and hence the - rear pointer which starts at 0 will also end up at zero; thus the zeroeth - element of the state information, which contains info about the current - position of the rear pointer is just - (MAX_TYPES * (rptr - state)) + TYPE_3 == TYPE_3. */ - -static long int randtbl[DEG_3 + 1] = - { - TYPE_3, - -851904987, -43806228, -2029755270, 1390239686, -1912102820, - -485608943, 1969813258, -1590463333, -1944053249, 455935928, 508023712, - -1714531963, 1800685987, -2015299881, 654595283, -1149023258, - -1470005550, -1143256056, -1325577603, -1568001885, 1275120390, - -607508183, -205999574, -1696891592, 1492211999, -1528267240, - -952028296, -189082757, 362343714, 1424981831, 2039449641, - }; - -/* FPTR and RPTR are two pointers into the state info, a front and a rear - pointer. These two pointers are always rand_sep places aparts, as they - cycle through the state information. (Yes, this does mean we could get - away with just one pointer, but the code for random is more efficient - this way). The pointers are left positioned as they would be from the call: - initstate(1, randtbl, 128); - (The position of the rear pointer, rptr, is really 0 (as explained above - in the initialization of randtbl) because the state table pointer is set - to point to randtbl[1] (as explained below).) */ - -static long int *fptr = &randtbl[SEP_3 + 1]; -static long int *rptr = &randtbl[1]; - - - -/* The following things are the pointer to the state information table, - the type of the current generator, the degree of the current polynomial - being used, and the separation between the two pointers. - Note that for efficiency of random, we remember the first location of - the state information, not the zeroeth. Hence it is valid to access - state[-1], which is used to store the type of the R.N.G. - Also, we remember the last location, since this is more efficient than - indexing every time to find the address of the last element to see if - the front and rear pointers have wrapped. */ - -static long int *state = &randtbl[1]; - -static int rand_type = TYPE_3; -static int rand_deg = DEG_3; -static int rand_sep = SEP_3; - -static long int *end_ptr = &randtbl[sizeof(randtbl) / sizeof(randtbl[0])]; - -/* Initialize the random number generator based on the given seed. If the - type is the trivial no-state-information type, just remember the seed. - Otherwise, initializes state[] based on the given "seed" via a linear - congruential generator. Then, the pointers are set to known locations - that are exactly rand_sep places apart. Lastly, it cycles the state - information a given number of times to get rid of any initial dependencies - introduced by the L.C.R.N.G. Note that the initialization of randtbl[] - for default usage relies on values produced by this routine. */ -void -DEFUN(__srandom, (x), unsigned int x) -{ - state[0] = x; - if (rand_type != TYPE_0) - { - register long int i; - for (i = 1; i < rand_deg; ++i) - state[i] = (1103515145 * state[i - 1]) + 12345; - fptr = &state[rand_sep]; - rptr = &state[0]; - for (i = 0; i < 10 * rand_deg; ++i) - (void) __random(); - } -} - -/* Initialize the state information in the given array of N bytes for - future random number generation. Based on the number of bytes we - are given, and the break values for the different R.N.G.'s, we choose - the best (largest) one we can and set things up for it. srandom is - then called to initialize the state information. Note that on return - from srandom, we set state[-1] to be the type multiplexed with the current - value of the rear pointer; this is so successive calls to initstate won't - lose this information and will be able to restart with setstate. - Note: The first thing we do is save the current state, if any, just like - setstate so that it doesn't matter when initstate is called. - Returns a pointer to the old state. */ -PTR -DEFUN(__initstate, (seed, arg_state, n), - unsigned int seed AND PTR arg_state AND size_t n) -{ - PTR ostate = (PTR) &state[-1]; - - if (rand_type == TYPE_0) - state[-1] = rand_type; - else - state[-1] = (MAX_TYPES * (rptr - state)) + rand_type; - if (n < BREAK_1) - { - if (n < BREAK_0) - { - errno = EINVAL; - return NULL; - } - rand_type = TYPE_0; - rand_deg = DEG_0; - rand_sep = SEP_0; - } - else if (n < BREAK_2) - { - rand_type = TYPE_1; - rand_deg = DEG_1; - rand_sep = SEP_1; - } - else if (n < BREAK_3) - { - rand_type = TYPE_2; - rand_deg = DEG_2; - rand_sep = SEP_2; - } - else if (n < BREAK_4) - { - rand_type = TYPE_3; - rand_deg = DEG_3; - rand_sep = SEP_3; - } - else - { - rand_type = TYPE_4; - rand_deg = DEG_4; - rand_sep = SEP_4; - } - - state = &((long int *) arg_state)[1]; /* First location. */ - /* Must set END_PTR before srandom. */ - end_ptr = &state[rand_deg]; - __srandom(seed); - if (rand_type == TYPE_0) - state[-1] = rand_type; - else - state[-1] = (MAX_TYPES * (rptr - state)) + rand_type; - - return ostate; -} - -/* Restore the state from the given state array. - Note: It is important that we also remember the locations of the pointers - in the current state information, and restore the locations of the pointers - from the old state information. This is done by multiplexing the pointer - location into the zeroeth word of the state information. Note that due - to the order in which things are done, it is OK to call setstate with the - same state as the current state - Returns a pointer to the old state information. */ -PTR -DEFUN(__setstate, (arg_state), PTR arg_state) -{ - register long int *new_state = (long int *) arg_state; - register int type = new_state[0] % MAX_TYPES; - register int rear = new_state[0] / MAX_TYPES; - PTR ostate = (PTR) &state[-1]; - - if (rand_type == TYPE_0) - state[-1] = rand_type; - else - state[-1] = (MAX_TYPES * (rptr - state)) + rand_type; - - switch (type) - { - case TYPE_0: - case TYPE_1: - case TYPE_2: - case TYPE_3: - case TYPE_4: - rand_type = type; - rand_deg = degrees[type]; - rand_sep = seps[type]; - break; - default: - /* State info munged. */ - errno = EINVAL; - return NULL; - } - - state = &new_state[1]; - if (rand_type != TYPE_0) - { - rptr = &state[rear]; - fptr = &state[(rear + rand_sep) % rand_deg]; - } - /* Set end_ptr too. */ - end_ptr = &state[rand_deg]; - - return ostate; -} - -/* If we are using the trivial TYPE_0 R.N.G., just do the old linear - congruential bit. Otherwise, we do our fancy trinomial stuff, which is the - same in all ther other cases due to all the global variables that have been - set up. The basic operation is to add the number at the rear pointer into - the one at the front pointer. Then both pointers are advanced to the next - location cyclically in the table. The value returned is the sum generated, - reduced to 31 bits by throwing away the "least random" low bit. - Note: The code takes advantage of the fact that both the front and - rear pointers can't wrap on the same call by not testing the rear - pointer if the front one has wrapped. Returns a 31-bit random number. */ - -long int DEFUN_VOID(__random) -/* long int random(void) */ -/* Use this one if your system complains about the DEFUN_VOID statement */ -{ - if (rand_type == TYPE_0) - { - state[0] = ((state[0] * 1103515245) + 12345) & LONG_MAX; - return state[0]; - } - else - { - long int i; - *fptr += *rptr; - /* Chucking least random bit. */ - i = (*fptr >> 1) & LONG_MAX; - ++fptr; - if (fptr >= end_ptr) - { - fptr = state; - ++rptr; - } - else - { - ++rptr; - if (rptr >= end_ptr) - rptr = state; - } - return i; - } -} diff -Nru dealer-20161012/Random/README dealer-20190529+ds/Random/README --- dealer-20161012/Random/README 2004-01-18 21:23:47.000000000 +0000 +++ dealer-20190529+ds/Random/README 1970-01-01 00:00:00.000000000 +0000 @@ -1,2 +0,0 @@ -This directory contains the GNU random generator stuff. Please see -the files GPL and GPL.lib for copyright info. diff -Nru dealer-20161012/Random/srand.c dealer-20190529+ds/Random/srand.c --- dealer-20161012/Random/srand.c 2004-01-18 21:23:47.000000000 +0000 +++ dealer-20190529+ds/Random/srand.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,33 +0,0 @@ -/* - This code has been introduced by Bruce Moore -*/ - -/* Copyright (C) 1991 Free Software Foundation, Inc. -This file is part of the GNU C Library. - -The GNU C Library is free software; you can redistribute it and/or -modify it under the terms of the GNU Library General Public License as -published by the Free Software Foundation; either version 2 of the -License, or (at your option) any later version. - -The GNU C Library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Library General Public License for more details. - -You should have received a copy of the GNU Library General Public -License along with the GNU C Library; see the file COPYING.LIB. If -not, write to the Free Software Foundation, Inc., 675 Mass Ave, -Cambridge, MA 02139, USA. */ - -#include "ansidecl.h" - -#undef srand - -int __srandom(unsigned int); - -int gnusrand(unsigned int seed) -{ - return (int) __srandom(seed); -} - diff -Nru dealer-20161012/scan.c dealer-20190529+ds/scan.c --- dealer-20161012/scan.c 2016-10-12 17:15:35.000000000 +0000 +++ dealer-20190529+ds/scan.c 2019-05-29 15:35:24.000000000 +0000 @@ -1,5 +1,5 @@ -#line 3 "" +#line 2 "" #define YY_INT_ALIGNED short int @@ -8,7 +8,7 @@ #define FLEX_SCANNER #define YY_FLEX_MAJOR_VERSION 2 #define YY_FLEX_MINOR_VERSION 6 -#define YY_FLEX_SUBMINOR_VERSION 0 +#define YY_FLEX_SUBMINOR_VERSION 4 #if YY_FLEX_SUBMINOR_VERSION > 0 #define FLEX_BETA #endif @@ -83,60 +83,48 @@ #define UINT32_MAX (4294967295U) #endif +#ifndef SIZE_MAX +#define SIZE_MAX (~(size_t)0) +#endif + #endif /* ! C99 */ #endif /* ! FLEXINT_H */ -#ifdef __cplusplus - -/* The "const" storage-class-modifier is valid. */ -#define YY_USE_CONST - -#else /* ! __cplusplus */ +/* begin standard C++ headers. */ -/* C99 requires __STDC__ to be defined as 1. */ -#if defined (__STDC__) - -#define YY_USE_CONST - -#endif /* defined (__STDC__) */ -#endif /* ! __cplusplus */ - -#ifdef YY_USE_CONST +/* TODO: this is always defined, so inline it */ #define yyconst const + +#if defined(__GNUC__) && __GNUC__ >= 3 +#define yynoreturn __attribute__((__noreturn__)) #else -#define yyconst +#define yynoreturn #endif /* Returned upon end-of-file. */ #define YY_NULL 0 -/* Promotes a possibly negative, possibly signed char to an unsigned - * integer for use as an array index. If the signed char is negative, - * we want to instead treat it as an 8-bit unsigned char, hence the - * double cast. +/* Promotes a possibly negative, possibly signed char to an + * integer in range [0..255] for use as an array index. */ -#define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c) +#define YY_SC_TO_UI(c) ((YY_CHAR) (c)) /* Enter a start condition. This macro really ought to take a parameter, * but we do it the disgusting crufty way forced on us by the ()-less * definition of BEGIN. */ #define BEGIN (yy_start) = 1 + 2 * - /* Translate the current start state into a value that can be later handed * to BEGIN to return to the state. The YYSTATE alias is for lex * compatibility. */ #define YY_START (((yy_start) - 1) / 2) #define YYSTATE YY_START - /* Action number for EOF rule of a given start state. */ #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1) - /* Special action meaning "start processing a new file". */ -#define YY_NEW_FILE yyrestart(yyin ) - +#define YY_NEW_FILE yyrestart( yyin ) #define YY_END_OF_BUFFER_CHAR 0 /* Size of default input buffer. */ @@ -166,14 +154,14 @@ typedef size_t yy_size_t; #endif -extern yy_size_t yyleng; +extern int yyleng; extern FILE *yyin, *yyout; #define EOB_ACT_CONTINUE_SCAN 0 #define EOB_ACT_END_OF_FILE 1 #define EOB_ACT_LAST_MATCH 2 - + #define YY_LESS_LINENO(n) #define YY_LINENO_REWIND_TO(ptr) @@ -190,7 +178,6 @@ YY_DO_BEFORE_ACTION; /* set up yytext again */ \ } \ while ( 0 ) - #define unput(c) yyunput( c, (yytext_ptr) ) #ifndef YY_STRUCT_YY_BUFFER_STATE @@ -205,12 +192,12 @@ /* Size of input buffer in bytes, not including room for EOB * characters. */ - yy_size_t yy_buf_size; + int yy_buf_size; /* Number of characters read into yy_ch_buf, not including EOB * characters. */ - yy_size_t yy_n_chars; + int yy_n_chars; /* Whether we "own" the buffer - i.e., we know we created it, * and can realloc() it to grow it, and should free() it to @@ -233,7 +220,7 @@ int yy_bs_lineno; /**< The line count. */ int yy_bs_column; /**< The column count. */ - + /* Whether to try to fill the input buffer when we reach the * end of it. */ @@ -261,7 +248,7 @@ /* Stack of input buffers. */ static size_t yy_buffer_stack_top = 0; /**< index of top of stack. */ static size_t yy_buffer_stack_max = 0; /**< capacity of stack. */ -static YY_BUFFER_STATE * yy_buffer_stack = 0; /**< Stack as an array. */ +static YY_BUFFER_STATE * yy_buffer_stack = NULL; /**< Stack as an array. */ /* We provide macros for accessing buffer states in case in the * future we want to put the buffer states in a more general @@ -272,7 +259,6 @@ #define YY_CURRENT_BUFFER ( (yy_buffer_stack) \ ? (yy_buffer_stack)[(yy_buffer_stack_top)] \ : NULL) - /* Same as previous macro, but useful when we know that the buffer stack is not * NULL or when we need an lvalue. For internal use only. */ @@ -280,11 +266,11 @@ /* yy_hold_char holds the character lost when yytext is formed. */ static char yy_hold_char; -static yy_size_t yy_n_chars; /* number of characters read into yy_ch_buf */ -yy_size_t yyleng; +static int yy_n_chars; /* number of characters read into yy_ch_buf */ +int yyleng; /* Points to current character in buffer. */ -static char *yy_c_buf_p = (char *) 0; +static char *yy_c_buf_p = NULL; static int yy_init = 0; /* whether we need to initialize */ static int yy_start = 0; /* start state number */ @@ -293,60 +279,55 @@ */ static int yy_did_buffer_switch_on_eof; -void yyrestart (FILE *input_file ); -void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer ); -YY_BUFFER_STATE yy_create_buffer (FILE *file,int size ); -void yy_delete_buffer (YY_BUFFER_STATE b ); -void yy_flush_buffer (YY_BUFFER_STATE b ); -void yypush_buffer_state (YY_BUFFER_STATE new_buffer ); -void yypop_buffer_state (void ); - -static void yyensure_buffer_stack (void ); -static void yy_load_buffer_state (void ); -static void yy_init_buffer (YY_BUFFER_STATE b,FILE *file ); - -#define YY_FLUSH_BUFFER yy_flush_buffer(YY_CURRENT_BUFFER ) - -YY_BUFFER_STATE yy_scan_buffer (char *base,yy_size_t size ); -YY_BUFFER_STATE yy_scan_string (yyconst char *yy_str ); -YY_BUFFER_STATE yy_scan_bytes (yyconst char *bytes,yy_size_t len ); - -void *yyalloc (yy_size_t ); -void *yyrealloc (void *,yy_size_t ); -void yyfree (void * ); +void yyrestart ( FILE *input_file ); +void yy_switch_to_buffer ( YY_BUFFER_STATE new_buffer ); +YY_BUFFER_STATE yy_create_buffer ( FILE *file, int size ); +void yy_delete_buffer ( YY_BUFFER_STATE b ); +void yy_flush_buffer ( YY_BUFFER_STATE b ); +void yypush_buffer_state ( YY_BUFFER_STATE new_buffer ); +void yypop_buffer_state ( void ); + +static void yyensure_buffer_stack ( void ); +static void yy_load_buffer_state ( void ); +static void yy_init_buffer ( YY_BUFFER_STATE b, FILE *file ); +#define YY_FLUSH_BUFFER yy_flush_buffer( YY_CURRENT_BUFFER ) + +YY_BUFFER_STATE yy_scan_buffer ( char *base, yy_size_t size ); +YY_BUFFER_STATE yy_scan_string ( const char *yy_str ); +YY_BUFFER_STATE yy_scan_bytes ( const char *bytes, int len ); + +void *yyalloc ( yy_size_t ); +void *yyrealloc ( void *, yy_size_t ); +void yyfree ( void * ); #define yy_new_buffer yy_create_buffer - #define yy_set_interactive(is_interactive) \ { \ if ( ! YY_CURRENT_BUFFER ){ \ yyensure_buffer_stack (); \ YY_CURRENT_BUFFER_LVALUE = \ - yy_create_buffer(yyin,YY_BUF_SIZE ); \ + yy_create_buffer( yyin, YY_BUF_SIZE ); \ } \ YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \ } - #define yy_set_bol(at_bol) \ { \ if ( ! YY_CURRENT_BUFFER ){\ yyensure_buffer_stack (); \ YY_CURRENT_BUFFER_LVALUE = \ - yy_create_buffer(yyin,YY_BUF_SIZE ); \ + yy_create_buffer( yyin, YY_BUF_SIZE ); \ } \ YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \ } - #define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol) -typedef unsigned char YY_CHAR; +typedef flex_uint8_t YY_CHAR; -FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0; +FILE *yyin = NULL, *yyout = NULL; typedef int yy_state_type; extern int yylineno; - int yylineno = 1; extern char *yytext; @@ -355,24 +336,20 @@ #endif #define yytext_ptr yytext -static yy_state_type yy_get_previous_state (void ); -static yy_state_type yy_try_NUL_trans (yy_state_type current_state ); -static int yy_get_next_buffer (void ); -#if defined(__GNUC__) && __GNUC__ >= 3 -__attribute__((__noreturn__)) -#endif -static void yy_fatal_error (yyconst char msg[] ); +static yy_state_type yy_get_previous_state ( void ); +static yy_state_type yy_try_NUL_trans ( yy_state_type current_state ); +static int yy_get_next_buffer ( void ); +static void yynoreturn yy_fatal_error ( const char* msg ); /* Done after the current pattern has been matched and before the * corresponding action - sets up yytext. */ #define YY_DO_BEFORE_ACTION \ (yytext_ptr) = yy_bp; \ - yyleng = (size_t) (yy_cp - yy_bp); \ + yyleng = (int) (yy_cp - yy_bp); \ (yy_hold_char) = *yy_cp; \ *yy_cp = '\0'; \ (yy_c_buf_p) = yy_cp; - #define YY_NUM_RULES 106 #define YY_END_OF_BUFFER 107 /* This struct is not used in this scanner, @@ -382,7 +359,7 @@ flex_int32_t yy_verify; flex_int32_t yy_nxt; }; -static yyconst flex_int16_t yy_accept[355] = +static const flex_int16_t yy_accept[355] = { 0, 0, 0, 22, 22, 107, 105, 102, 103, 105, 5, 105, 17, 105, 15, 13, 14, 16, 100, 100, 19, @@ -425,7 +402,7 @@ 42, 39, 40, 0 } ; -static yyconst YY_CHAR yy_ec[256] = +static const YY_CHAR yy_ec[256] = { 0, 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, 1, 1, 4, 1, 1, 1, 1, 1, 1, 1, @@ -457,7 +434,7 @@ 1, 1, 1, 1, 1 } ; -static yyconst YY_CHAR yy_meta[69] = +static const YY_CHAR yy_meta[69] = { 0, 1, 1, 2, 1, 1, 1, 1, 1, 1, 3, 1, 1, 1, 4, 4, 4, 4, 4, 4, 4, @@ -468,7 +445,7 @@ 5, 5, 5, 5, 5, 4, 5, 1 } ; -static yyconst flex_uint16_t yy_base[367] = +static const flex_int16_t yy_base[367] = { 0, 0, 505, 66, 69, 511, 513, 513, 513, 67, 484, 503, 513, 499, 513, 513, 513, 64, 441, 42, 513, @@ -512,7 +489,7 @@ 354, 359, 172, 171, 140, 88 } ; -static yyconst flex_int16_t yy_def[367] = +static const flex_int16_t yy_def[367] = { 0, 354, 1, 355, 355, 354, 354, 354, 354, 354, 354, 356, 354, 354, 354, 354, 354, 354, 357, 357, 354, @@ -556,7 +533,7 @@ 354, 354, 354, 354, 354, 354 } ; -static yyconst flex_uint16_t yy_nxt[582] = +static const flex_int16_t yy_nxt[582] = { 0, 6, 7, 8, 9, 10, 11, 6, 12, 13, 14, 15, 16, 17, 18, 18, 19, 19, 19, 19, 19, @@ -624,7 +601,7 @@ 354 } ; -static yyconst flex_int16_t yy_chk[582] = +static const flex_int16_t yy_chk[582] = { 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, @@ -709,7 +686,7 @@ #line 1 "scan.l" /* $Header: /home/henk/CVS/dealer/scan.l,v 1.8 1999/07/05 19:44:30 henk Exp $ */ -#line 713 "" +#line 689 "" #define INITIAL 0 #define COMMENT 1 @@ -726,36 +703,36 @@ #define YY_EXTRA_TYPE void * #endif -static int yy_init_globals (void ); +static int yy_init_globals ( void ); /* Accessor methods to globals. These are made visible to non-reentrant scanners for convenience. */ -int yylex_destroy (void ); +int yylex_destroy ( void ); -int yyget_debug (void ); +int yyget_debug ( void ); -void yyset_debug (int debug_flag ); +void yyset_debug ( int debug_flag ); -YY_EXTRA_TYPE yyget_extra (void ); +YY_EXTRA_TYPE yyget_extra ( void ); -void yyset_extra (YY_EXTRA_TYPE user_defined ); +void yyset_extra ( YY_EXTRA_TYPE user_defined ); -FILE *yyget_in (void ); +FILE *yyget_in ( void ); -void yyset_in (FILE * _in_str ); +void yyset_in ( FILE * _in_str ); -FILE *yyget_out (void ); +FILE *yyget_out ( void ); -void yyset_out (FILE * _out_str ); +void yyset_out ( FILE * _out_str ); -yy_size_t yyget_leng (void ); + int yyget_leng ( void ); -char *yyget_text (void ); +char *yyget_text ( void ); -int yyget_lineno (void ); +int yyget_lineno ( void ); -void yyset_lineno (int _line_number ); +void yyset_lineno ( int _line_number ); /* Macros after this point can all be overridden by user definitions in * section 1. @@ -763,32 +740,31 @@ #ifndef YY_SKIP_YYWRAP #ifdef __cplusplus -extern "C" int yywrap (void ); +extern "C" int yywrap ( void ); #else -extern int yywrap (void ); +extern int yywrap ( void ); #endif #endif #ifndef YY_NO_UNPUT - static void yyunput (int c,char *buf_ptr ); + static void yyunput ( int c, char *buf_ptr ); #endif #ifndef yytext_ptr -static void yy_flex_strncpy (char *,yyconst char *,int ); +static void yy_flex_strncpy ( char *, const char *, int ); #endif #ifdef YY_NEED_STRLEN -static int yy_flex_strlen (yyconst char * ); +static int yy_flex_strlen ( const char * ); #endif #ifndef YY_NO_INPUT - #ifdef __cplusplus -static int yyinput (void ); +static int yyinput ( void ); #else -static int input (void ); +static int input ( void ); #endif #endif @@ -808,7 +784,7 @@ /* This used to be an fputs(), but since the string might contain NUL's, * we now use fwrite(). */ -#define ECHO do { if (fwrite( yytext, yyleng, 1, yyout )) {} } while (0) +#define ECHO do { if (fwrite( yytext, (size_t) yyleng, 1, yyout )) {} } while (0) #endif /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL, @@ -819,7 +795,7 @@ if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \ { \ int c = '*'; \ - size_t n; \ + int n; \ for ( n = 0; n < max_size && \ (c = getc( yyin )) != EOF && c != '\n'; ++n ) \ buf[n] = (char) c; \ @@ -832,7 +808,7 @@ else \ { \ errno=0; \ - while ( (result = fread(buf, 1, max_size, yyin))==0 && ferror(yyin)) \ + while ( (result = (int) fread(buf, 1, (yy_size_t) max_size, yyin)) == 0 && ferror(yyin)) \ { \ if( errno != EINTR) \ { \ @@ -924,16 +900,16 @@ if ( ! YY_CURRENT_BUFFER ) { yyensure_buffer_stack (); YY_CURRENT_BUFFER_LVALUE = - yy_create_buffer(yyin,YY_BUF_SIZE ); + yy_create_buffer( yyin, YY_BUF_SIZE ); } - yy_load_buffer_state( ); + yy_load_buffer_state( ); } { #line 3 "scan.l" -#line 937 "" +#line 912 "" while ( /*CONSTCOND*/1 ) /* loops until end-of-file is reached */ { @@ -962,9 +938,9 @@ { yy_current_state = (int) yy_def[yy_current_state]; if ( yy_current_state >= 355 ) - yy_c = yy_meta[(unsigned int) yy_c]; + yy_c = yy_meta[yy_c]; } - yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; + yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c]; ++yy_cp; } while ( yy_base[yy_current_state] != 513 ); @@ -1535,7 +1511,7 @@ #line 118 "scan.l" ECHO; YY_BREAK -#line 1539 "" +#line 1514 "" case YY_STATE_EOF(INITIAL): yyterminate(); @@ -1613,7 +1589,7 @@ { (yy_did_buffer_switch_on_eof) = 0; - if ( yywrap( ) ) + if ( yywrap( ) ) { /* Note: because we've taken care in * yy_get_next_buffer() to have set up @@ -1680,7 +1656,7 @@ { char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf; char *source = (yytext_ptr); - yy_size_t number_to_move, i; + int number_to_move, i; int ret_val; if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] ) @@ -1709,7 +1685,7 @@ /* Try to read more data. */ /* First move last chars to start of buffer. */ - number_to_move = (yy_size_t) ((yy_c_buf_p) - (yytext_ptr)) - 1; + number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr) - 1); for ( i = 0; i < number_to_move; ++i ) *(dest++) = *(source++); @@ -1722,7 +1698,7 @@ else { - yy_size_t num_to_read = + int num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1; while ( num_to_read <= 0 ) @@ -1736,7 +1712,7 @@ if ( b->yy_is_our_buffer ) { - yy_size_t new_size = b->yy_buf_size * 2; + int new_size = b->yy_buf_size * 2; if ( new_size <= 0 ) b->yy_buf_size += b->yy_buf_size / 8; @@ -1745,11 +1721,12 @@ b->yy_ch_buf = (char *) /* Include room in for 2 EOB chars. */ - yyrealloc((void *) b->yy_ch_buf,b->yy_buf_size + 2 ); + yyrealloc( (void *) b->yy_ch_buf, + (yy_size_t) (b->yy_buf_size + 2) ); } else /* Can't grow it, we don't own it. */ - b->yy_ch_buf = 0; + b->yy_ch_buf = NULL; if ( ! b->yy_ch_buf ) YY_FATAL_ERROR( @@ -1777,7 +1754,7 @@ if ( number_to_move == YY_MORE_ADJ ) { ret_val = EOB_ACT_END_OF_FILE; - yyrestart(yyin ); + yyrestart( yyin ); } else @@ -1791,12 +1768,15 @@ else ret_val = EOB_ACT_CONTINUE_SCAN; - if ((yy_size_t) ((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) { + if (((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) { /* Extend the array by 50%, plus the number we really need. */ - yy_size_t new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1); - YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yyrealloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size ); + int new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1); + YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yyrealloc( + (void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf, (yy_size_t) new_size ); if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf ) YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" ); + /* "- 2" to take care of EOB's */ + YY_CURRENT_BUFFER_LVALUE->yy_buf_size = (int) (new_size - 2); } (yy_n_chars) += number_to_move; @@ -1830,9 +1810,9 @@ { yy_current_state = (int) yy_def[yy_current_state]; if ( yy_current_state >= 355 ) - yy_c = yy_meta[(unsigned int) yy_c]; + yy_c = yy_meta[yy_c]; } - yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; + yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c]; } return yy_current_state; @@ -1858,9 +1838,9 @@ { yy_current_state = (int) yy_def[yy_current_state]; if ( yy_current_state >= 355 ) - yy_c = yy_meta[(unsigned int) yy_c]; + yy_c = yy_meta[yy_c]; } - yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; + yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c]; yy_is_jam = (yy_current_state == 354); return yy_is_jam ? 0 : yy_current_state; @@ -1880,7 +1860,7 @@ if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 ) { /* need to shift things up to make room */ /* +2 for EOB chars. */ - yy_size_t number_to_move = (yy_n_chars) + 2; + int number_to_move = (yy_n_chars) + 2; char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[ YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2]; char *source = @@ -1892,7 +1872,7 @@ yy_cp += (int) (dest - source); yy_bp += (int) (dest - source); YY_CURRENT_BUFFER_LVALUE->yy_n_chars = - (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_buf_size; + (yy_n_chars) = (int) YY_CURRENT_BUFFER_LVALUE->yy_buf_size; if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 ) YY_FATAL_ERROR( "flex scanner push-back overflow" ); @@ -1931,7 +1911,7 @@ else { /* need more input */ - yy_size_t offset = (yy_c_buf_p) - (yytext_ptr); + int offset = (int) ((yy_c_buf_p) - (yytext_ptr)); ++(yy_c_buf_p); switch ( yy_get_next_buffer( ) ) @@ -1948,14 +1928,14 @@ */ /* Reset buffer status. */ - yyrestart(yyin ); + yyrestart( yyin ); /*FALLTHROUGH*/ case EOB_ACT_END_OF_FILE: { - if ( yywrap( ) ) - return EOF; + if ( yywrap( ) ) + return 0; if ( ! (yy_did_buffer_switch_on_eof) ) YY_NEW_FILE; @@ -1994,11 +1974,11 @@ if ( ! YY_CURRENT_BUFFER ){ yyensure_buffer_stack (); YY_CURRENT_BUFFER_LVALUE = - yy_create_buffer(yyin,YY_BUF_SIZE ); + yy_create_buffer( yyin, YY_BUF_SIZE ); } - yy_init_buffer(YY_CURRENT_BUFFER,input_file ); - yy_load_buffer_state( ); + yy_init_buffer( YY_CURRENT_BUFFER, input_file ); + yy_load_buffer_state( ); } /** Switch to a different input buffer. @@ -2026,7 +2006,7 @@ } YY_CURRENT_BUFFER_LVALUE = new_buffer; - yy_load_buffer_state( ); + yy_load_buffer_state( ); /* We don't actually know whether we did this switch during * EOF (yywrap()) processing, but the only time this flag @@ -2054,22 +2034,22 @@ { YY_BUFFER_STATE b; - b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state ) ); + b = (YY_BUFFER_STATE) yyalloc( sizeof( struct yy_buffer_state ) ); if ( ! b ) YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); - b->yy_buf_size = (yy_size_t)size; + b->yy_buf_size = size; /* yy_ch_buf has to be 2 characters longer than the size given because * we need to put in 2 end-of-buffer characters. */ - b->yy_ch_buf = (char *) yyalloc(b->yy_buf_size + 2 ); + b->yy_ch_buf = (char *) yyalloc( (yy_size_t) (b->yy_buf_size + 2) ); if ( ! b->yy_ch_buf ) YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); b->yy_is_our_buffer = 1; - yy_init_buffer(b,file ); + yy_init_buffer( b, file ); return b; } @@ -2088,9 +2068,9 @@ YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0; if ( b->yy_is_our_buffer ) - yyfree((void *) b->yy_ch_buf ); + yyfree( (void *) b->yy_ch_buf ); - yyfree((void *) b ); + yyfree( (void *) b ); } /* Initializes or reinitializes a buffer. @@ -2102,7 +2082,7 @@ { int oerrno = errno; - yy_flush_buffer(b ); + yy_flush_buffer( b ); b->yy_input_file = file; b->yy_fill_buffer = 1; @@ -2145,7 +2125,7 @@ b->yy_buffer_status = YY_BUFFER_NEW; if ( b == YY_CURRENT_BUFFER ) - yy_load_buffer_state( ); + yy_load_buffer_state( ); } /** Pushes the new state onto the stack. The new state becomes @@ -2176,7 +2156,7 @@ YY_CURRENT_BUFFER_LVALUE = new_buffer; /* copied from yy_switch_to_buffer. */ - yy_load_buffer_state( ); + yy_load_buffer_state( ); (yy_did_buffer_switch_on_eof) = 1; } @@ -2195,7 +2175,7 @@ --(yy_buffer_stack_top); if (YY_CURRENT_BUFFER) { - yy_load_buffer_state( ); + yy_load_buffer_state( ); (yy_did_buffer_switch_on_eof) = 1; } } @@ -2213,15 +2193,15 @@ * scanner will even need a stack. We use 2 instead of 1 to avoid an * immediate realloc on the next call. */ - num_to_alloc = 1; // After all that talk, this was set to 1 anyways... + num_to_alloc = 1; /* After all that talk, this was set to 1 anyways... */ (yy_buffer_stack) = (struct yy_buffer_state**)yyalloc (num_to_alloc * sizeof(struct yy_buffer_state*) ); if ( ! (yy_buffer_stack) ) YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" ); - + memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*)); - + (yy_buffer_stack_max) = num_to_alloc; (yy_buffer_stack_top) = 0; return; @@ -2250,7 +2230,7 @@ * @param base the character buffer * @param size the size in bytes of the character buffer * - * @return the newly allocated buffer state object. + * @return the newly allocated buffer state object. */ YY_BUFFER_STATE yy_scan_buffer (char * base, yy_size_t size ) { @@ -2260,23 +2240,23 @@ base[size-2] != YY_END_OF_BUFFER_CHAR || base[size-1] != YY_END_OF_BUFFER_CHAR ) /* They forgot to leave room for the EOB's. */ - return 0; + return NULL; - b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state ) ); + b = (YY_BUFFER_STATE) yyalloc( sizeof( struct yy_buffer_state ) ); if ( ! b ) YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" ); - b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */ + b->yy_buf_size = (int) (size - 2); /* "- 2" to take care of EOB's */ b->yy_buf_pos = b->yy_ch_buf = base; b->yy_is_our_buffer = 0; - b->yy_input_file = 0; + b->yy_input_file = NULL; b->yy_n_chars = b->yy_buf_size; b->yy_is_interactive = 0; b->yy_at_bol = 1; b->yy_fill_buffer = 0; b->yy_buffer_status = YY_BUFFER_NEW; - yy_switch_to_buffer(b ); + yy_switch_to_buffer( b ); return b; } @@ -2289,10 +2269,10 @@ * @note If you want to scan bytes that may contain NUL values, then use * yy_scan_bytes() instead. */ -YY_BUFFER_STATE yy_scan_string (yyconst char * yystr ) +YY_BUFFER_STATE yy_scan_string (const char * yystr ) { - return yy_scan_bytes(yystr,strlen(yystr) ); + return yy_scan_bytes( yystr, (int) strlen(yystr) ); } /** Setup the input buffer state to scan the given bytes. The next call to yylex() will @@ -2302,16 +2282,16 @@ * * @return the newly allocated buffer state object. */ -YY_BUFFER_STATE yy_scan_bytes (yyconst char * yybytes, yy_size_t _yybytes_len ) +YY_BUFFER_STATE yy_scan_bytes (const char * yybytes, int _yybytes_len ) { YY_BUFFER_STATE b; char *buf; yy_size_t n; - yy_size_t i; + int i; /* Get memory for full buffer, including space for trailing EOB's. */ - n = _yybytes_len + 2; - buf = (char *) yyalloc(n ); + n = (yy_size_t) (_yybytes_len + 2); + buf = (char *) yyalloc( n ); if ( ! buf ) YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" ); @@ -2320,7 +2300,7 @@ buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR; - b = yy_scan_buffer(buf,n ); + b = yy_scan_buffer( buf, n ); if ( ! b ) YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" ); @@ -2336,9 +2316,9 @@ #define YY_EXIT_FAILURE 2 #endif -static void yy_fatal_error (yyconst char* msg ) +static void yynoreturn yy_fatal_error (const char* msg ) { - (void) fprintf( stderr, "%s\n", msg ); + fprintf( stderr, "%s\n", msg ); exit( YY_EXIT_FAILURE ); } @@ -2366,7 +2346,7 @@ */ int yyget_lineno (void) { - + return yylineno; } @@ -2389,7 +2369,7 @@ /** Get the length of the current token. * */ -yy_size_t yyget_leng (void) +int yyget_leng (void) { return yyleng; } @@ -2445,10 +2425,10 @@ * This function is called from yylex_destroy(), so don't allocate here. */ - (yy_buffer_stack) = 0; + (yy_buffer_stack) = NULL; (yy_buffer_stack_top) = 0; (yy_buffer_stack_max) = 0; - (yy_c_buf_p) = (char *) 0; + (yy_c_buf_p) = NULL; (yy_init) = 0; (yy_start) = 0; @@ -2457,8 +2437,8 @@ yyin = stdin; yyout = stdout; #else - yyin = (FILE *) 0; - yyout = (FILE *) 0; + yyin = NULL; + yyout = NULL; #endif /* For future reference: Set errno on error, since we are called by @@ -2473,7 +2453,7 @@ /* Pop the buffer stack, destroying each element. */ while(YY_CURRENT_BUFFER){ - yy_delete_buffer(YY_CURRENT_BUFFER ); + yy_delete_buffer( YY_CURRENT_BUFFER ); YY_CURRENT_BUFFER_LVALUE = NULL; yypop_buffer_state(); } @@ -2494,7 +2474,7 @@ */ #ifndef yytext_ptr -static void yy_flex_strncpy (char* s1, yyconst char * s2, int n ) +static void yy_flex_strncpy (char* s1, const char * s2, int n ) { int i; @@ -2504,7 +2484,7 @@ #endif #ifdef YY_NEED_STRLEN -static int yy_flex_strlen (yyconst char * s ) +static int yy_flex_strlen (const char * s ) { int n; for ( n = 0; s[n]; ++n ) @@ -2516,7 +2496,7 @@ void *yyalloc (yy_size_t size ) { - return (void *) malloc( size ); + return malloc(size); } void *yyrealloc (void * ptr, yy_size_t size ) @@ -2529,7 +2509,7 @@ * any pointer type to void*, and deal with argument conversions * as though doing an assignment. */ - return (void *) realloc( (char *) ptr, size ); + return realloc(ptr, size); } void yyfree (void * ptr ) diff -Nru dealer-20161012/srand.c dealer-20190529+ds/srand.c --- dealer-20161012/srand.c 1970-01-01 00:00:00.000000000 +0000 +++ dealer-20190529+ds/srand.c 2004-01-18 21:23:47.000000000 +0000 @@ -0,0 +1,33 @@ +/* + This code has been introduced by Bruce Moore +*/ + +/* Copyright (C) 1991 Free Software Foundation, Inc. +This file is part of the GNU C Library. + +The GNU C Library is free software; you can redistribute it and/or +modify it under the terms of the GNU Library General Public License as +published by the Free Software Foundation; either version 2 of the +License, or (at your option) any later version. + +The GNU C Library is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +Library General Public License for more details. + +You should have received a copy of the GNU Library General Public +License along with the GNU C Library; see the file COPYING.LIB. If +not, write to the Free Software Foundation, Inc., 675 Mass Ave, +Cambridge, MA 02139, USA. */ + +#include "ansidecl.h" + +#undef srand + +int __srandom(unsigned int); + +int gnusrand(unsigned int seed) +{ + return (int) __srandom(seed); +} + diff -Nru dealer-20161012/test dealer-20190529+ds/test --- dealer-20161012/test 2013-04-04 04:55:35.000000000 +0000 +++ dealer-20190529+ds/test 1970-01-01 00:00:00.000000000 +0000 @@ -1,34 +0,0 @@ -dealer north - -((hcp(north)>=20) - -&& (hcp(north)<=21) - -&&shape(north, any 4333 + any 54xx + 3262 + 2263 + 2362 + 2236 + 3226 + 2326 - any 0xxx - any 1xxx) - -&&hcp(south)>=6 - -&&hcp(south)<=13 - -&&shape(south, any 44xx + any 54xx + xx5x + xxx5)) - -or - -((hcp(north)>=22) - -&& (hcp(north)<=23) - -&&shape(north, any 4333 + any 54xx + 3262 + 2263 + 2362 + 2236 + 3226 + 2326 - any 0xxx any 1xxx) - -&&hcp(south)>=4 - -&&shape(south, any 44xx + any 54xx + xx5x + xxx5)) - -or - -((hcp(north)>=24) - -&&shape(north, any 4333 + any 54xx + 3262 + 2263 + 2362 + 2236 + 3226 + 2326 - any 0xxx - any 1xxx) - -&&shape(south, any 44xx + any 54xx + xx5x + xxx5)) -