mirror of
https://github.com/vattam/BSDGames.git
synced 2025-12-21 03:14:50 +00:00
releasing version 2.17-1
git-svn-id: file:///srv/svn/joey/trunk/src/packages/bsdgames@11092 a4a2c43b-8ac3-0310-8836-e0e880c912e2
This commit is contained in:
@@ -1,10 +0,0 @@
|
||||
a.out
|
||||
*.d
|
||||
*.i
|
||||
*.s
|
||||
*.d.tmp
|
||||
monop
|
||||
initdeck
|
||||
pathnames.h
|
||||
monop.6
|
||||
cards.pck
|
||||
@@ -1,4 +1,4 @@
|
||||
/* $NetBSD: getinp.c,v 1.12 2004/01/27 20:30:30 jsm Exp $ */
|
||||
/* $NetBSD: getinp.c,v 1.13 2004/11/05 21:30:32 dsl Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1980, 1993
|
||||
@@ -34,7 +34,7 @@
|
||||
#if 0
|
||||
static char sccsid[] = "@(#)getinp.c 8.1 (Berkeley) 5/31/93";
|
||||
#else
|
||||
__RCSID("$NetBSD: getinp.c,v 1.12 2004/01/27 20:30:30 jsm Exp $");
|
||||
__RCSID("$NetBSD: getinp.c,v 1.13 2004/11/05 21:30:32 dsl Exp $");
|
||||
#endif
|
||||
#endif /* not lint */
|
||||
|
||||
@@ -91,8 +91,7 @@ inter:
|
||||
}
|
||||
*sp = '\0';
|
||||
for (sp = buf; *sp; sp++)
|
||||
if (isupper(*sp))
|
||||
*sp = tolower(*sp);
|
||||
*sp = tolower((unsigned char)*sp);
|
||||
for (i = n_match = 0; list[i]; i++)
|
||||
if (comp(list[i])) {
|
||||
n_match++;
|
||||
@@ -115,7 +114,7 @@ comp(s1)
|
||||
|
||||
if (buf[0] != '\0')
|
||||
for (sp = buf, tsp = s1; *sp; ) {
|
||||
c = isupper(*tsp) ? tolower(*tsp) : *tsp;
|
||||
c = tolower((unsigned char)*tsp);
|
||||
tsp++;
|
||||
if (c != *sp++)
|
||||
return 0;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* $NetBSD: malloc.c,v 1.3 2004/01/27 20:30:30 jsm Exp $ */
|
||||
/* $NetBSD: malloc.c,v 1.4 2004/12/14 00:21:01 nathanw Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1983, 1993
|
||||
@@ -34,7 +34,7 @@
|
||||
#if 0
|
||||
static char sccsid[] = "@(#)malloc.c 8.1 (Berkeley) 6/4/93";
|
||||
#else
|
||||
__RCSID("$NetBSD: malloc.c,v 1.3 2004/01/27 20:30:30 jsm Exp $");
|
||||
__RCSID("$NetBSD: malloc.c,v 1.4 2004/12/14 00:21:01 nathanw Exp $");
|
||||
#endif
|
||||
#endif /* LIBC_SCCS and not lint */
|
||||
|
||||
@@ -59,7 +59,7 @@ __RCSID("$NetBSD: malloc.c,v 1.3 2004/01/27 20:30:30 jsm Exp $");
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
#include <threadlib.h>
|
||||
#include <pthread.h>
|
||||
|
||||
|
||||
/*
|
||||
@@ -118,7 +118,7 @@ static int pagebucket; /* page size bucket */
|
||||
static u_int nmalloc[NBUCKETS];
|
||||
#endif
|
||||
|
||||
static mutex_t malloc_mutex = MUTEX_INITIALIZER;
|
||||
static pthread_mutex_t malloc_mutex = PTHREAD_MUTEX_INITIALIZER;
|
||||
|
||||
static void morecore(int);
|
||||
static int findbucket(union overhead *, int);
|
||||
@@ -176,7 +176,7 @@ malloc(nbytes)
|
||||
long n;
|
||||
unsigned amt;
|
||||
|
||||
mutex_lock(&malloc_mutex);
|
||||
pthread_mutex_lock(&malloc_mutex);
|
||||
|
||||
/*
|
||||
* First time malloc is called, setup page size and
|
||||
@@ -191,7 +191,7 @@ malloc(nbytes)
|
||||
n += pagesz;
|
||||
if (n) {
|
||||
if (sbrk((int)n) == (void *)-1) {
|
||||
mutex_unlock(&malloc_mutex);
|
||||
pthread_mutex_unlock(&malloc_mutex);
|
||||
return (NULL);
|
||||
}
|
||||
}
|
||||
@@ -234,7 +234,7 @@ malloc(nbytes)
|
||||
if ((op = nextf[bucket]) == NULL) {
|
||||
morecore(bucket);
|
||||
if ((op = nextf[bucket]) == NULL) {
|
||||
mutex_unlock(&malloc_mutex);
|
||||
pthread_mutex_unlock(&malloc_mutex);
|
||||
return (NULL);
|
||||
}
|
||||
}
|
||||
@@ -245,7 +245,7 @@ malloc(nbytes)
|
||||
#ifdef MSTATS
|
||||
nmalloc[bucket]++;
|
||||
#endif
|
||||
mutex_unlock(&malloc_mutex);
|
||||
pthread_mutex_unlock(&malloc_mutex);
|
||||
#ifdef RCHECK
|
||||
/*
|
||||
* Record allocated size of block and
|
||||
@@ -326,13 +326,13 @@ free(cp)
|
||||
#endif
|
||||
size = op->ov_index;
|
||||
ASSERT(size < NBUCKETS);
|
||||
mutex_lock(&malloc_mutex);
|
||||
pthread_mutex_lock(&malloc_mutex);
|
||||
op->ov_next = nextf[(unsigned int)size];/* also clobbers ov_magic */
|
||||
nextf[(unsigned int)size] = op;
|
||||
#ifdef MSTATS
|
||||
nmalloc[(size_t)size]--;
|
||||
#endif
|
||||
mutex_unlock(&malloc_mutex);
|
||||
pthread_mutex_unlock(&malloc_mutex);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -366,7 +366,7 @@ realloc(cp, nbytes)
|
||||
return (NULL);
|
||||
}
|
||||
op = (union overhead *)(void *)((caddr_t)cp - sizeof (union overhead));
|
||||
mutex_lock(&malloc_mutex);
|
||||
pthread_mutex_lock(&malloc_mutex);
|
||||
if (op->ov_magic == MAGIC) {
|
||||
was_alloced++;
|
||||
i = op->ov_index;
|
||||
@@ -408,7 +408,7 @@ realloc(cp, nbytes)
|
||||
op->ov_size = (nbytes + RSLOP - 1) & ~(RSLOP - 1);
|
||||
*(u_short *)((caddr_t)(op + 1) + op->ov_size) = RMAGIC;
|
||||
#endif
|
||||
mutex_unlock(&malloc_mutex);
|
||||
pthread_mutex_unlock(&malloc_mutex);
|
||||
return (cp);
|
||||
|
||||
}
|
||||
@@ -417,7 +417,7 @@ realloc(cp, nbytes)
|
||||
free(cp);
|
||||
#endif
|
||||
}
|
||||
mutex_unlock(&malloc_mutex);
|
||||
pthread_mutex_unlock(&malloc_mutex);
|
||||
if ((res = malloc(nbytes)) == NULL) {
|
||||
#ifdef _REENT
|
||||
free(cp);
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* $NetBSD: misc.c,v 1.12 2004/01/26 09:59:36 jsm Exp $ */
|
||||
/* $NetBSD: misc.c,v 1.13 2004/11/05 21:30:32 dsl Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1980, 1993
|
||||
@@ -34,7 +34,7 @@
|
||||
#if 0
|
||||
static char sccsid[] = "@(#)misc.c 8.1 (Berkeley) 5/31/93";
|
||||
#else
|
||||
__RCSID("$NetBSD: misc.c,v 1.12 2004/01/26 09:59:36 jsm Exp $");
|
||||
__RCSID("$NetBSD: misc.c,v 1.13 2004/11/05 21:30:32 dsl Exp $");
|
||||
#endif
|
||||
#endif /* not lint */
|
||||
|
||||
@@ -109,9 +109,9 @@ inter:
|
||||
*sp = c;
|
||||
if (sp == buf)
|
||||
continue;
|
||||
for (sp = buf; isspace(*sp); sp++)
|
||||
for (sp = buf; isspace((unsigned char)*sp); sp++)
|
||||
continue;
|
||||
for (; isdigit(*sp); sp++)
|
||||
for (; isdigit((unsigned char)*sp); sp++)
|
||||
num = num * 10 + *sp - '0';
|
||||
if (*sp == '\n')
|
||||
return num;
|
||||
|
||||
Reference in New Issue
Block a user