Merge branch 'NetHack-3.6.2-beta01' into NetHack-3.6.2
This commit is contained in:
+29
-1
@@ -2,7 +2,32 @@
|
|||||||
/* Copyright (c) 2016 by Michael Allison */
|
/* Copyright (c) 2016 by Michael Allison */
|
||||||
/* NetHack may be freely redistributed. See license for details. */
|
/* NetHack may be freely redistributed. See license for details. */
|
||||||
|
|
||||||
/* integer.h -- provide sized integer types */
|
/* integer.h -- provide sized integer types
|
||||||
|
*
|
||||||
|
* We try to sort out a way to provide sized integer types
|
||||||
|
* in here. The strong preference is to try and let a
|
||||||
|
* compiler-supplied header file set up the types.
|
||||||
|
*
|
||||||
|
* If your compiler is C99 conforming and sets a value of
|
||||||
|
* __STDC_VERSION__ >= 199901L, then <stdint.h> is supposed
|
||||||
|
* to be available for inclusion.
|
||||||
|
*
|
||||||
|
* If your compiler doesn't set __STDC_VERSION__ to indicate
|
||||||
|
* full conformance to C99, but does actually supply a suitable
|
||||||
|
* <stdint.h>, you can pass a compiler flag -DHAS_STDINT_H
|
||||||
|
* during build to cause the inclusion of <stdint.h> anyway.
|
||||||
|
*
|
||||||
|
* If <stdint.h> doesn't get included, then the code in the
|
||||||
|
* STDINT_WORKAROUND section of code is not skipped and will
|
||||||
|
* be used to set up the types.
|
||||||
|
*
|
||||||
|
* We acknowledge that some ongoing maintenance may be needed
|
||||||
|
* over time if people send us code updates for making the
|
||||||
|
* determination of whether <stdint.h> is available, or
|
||||||
|
* require adjustments to the base type used for some
|
||||||
|
* compiler/platform combinations.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
#ifndef INTEGER_H
|
#ifndef INTEGER_H
|
||||||
#define INTEGER_H
|
#define INTEGER_H
|
||||||
@@ -24,6 +49,9 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef SKIP_STDINT_WORKAROUND /* !C99 */
|
#ifndef SKIP_STDINT_WORKAROUND /* !C99 */
|
||||||
|
/*
|
||||||
|
* STDINT_WORKAROUND section begins here
|
||||||
|
*/
|
||||||
typedef unsigned char uint8_t;
|
typedef unsigned char uint8_t;
|
||||||
typedef short int16_t;
|
typedef short int16_t;
|
||||||
typedef unsigned short uint16_t;
|
typedef unsigned short uint16_t;
|
||||||
|
|||||||
+1
-1
@@ -1250,7 +1250,7 @@ register struct obj *obj;
|
|||||||
/* for "the Foo of Bar", only scuff "Foo of Bar" part */
|
/* for "the Foo of Bar", only scuff "Foo of Bar" part */
|
||||||
bufp = !strncmpi(bufcpy, "the ", 4) ? (buf + 4) : buf;
|
bufp = !strncmpi(bufcpy, "the ", 4) ? (buf + 4) : buf;
|
||||||
do {
|
do {
|
||||||
wipeout_text(bufp, rnd(2), (unsigned) 0);
|
wipeout_text(bufp, rn2_on_display_rng(2), (unsigned) 0);
|
||||||
} while (!strcmp(buf, bufcpy));
|
} while (!strcmp(buf, bufcpy));
|
||||||
pline("While engraving, your %s slips.", body_part(HAND));
|
pline("While engraving, your %s slips.", body_part(HAND));
|
||||||
display_nhwindow(WIN_MESSAGE, FALSE);
|
display_nhwindow(WIN_MESSAGE, FALSE);
|
||||||
|
|||||||
+8
-3
@@ -852,6 +852,7 @@ STATIC_DCL struct tm *NDECL(getlt);
|
|||||||
|
|
||||||
/* Sets the seed for the random number generator */
|
/* Sets the seed for the random number generator */
|
||||||
#ifdef USE_ISAAC64
|
#ifdef USE_ISAAC64
|
||||||
|
|
||||||
static void
|
static void
|
||||||
set_random(seed, fn)
|
set_random(seed, fn)
|
||||||
unsigned long seed;
|
unsigned long seed;
|
||||||
@@ -859,11 +860,14 @@ int FDECL((*fn), (int));
|
|||||||
{
|
{
|
||||||
init_isaac64(seed, fn);
|
init_isaac64(seed, fn);
|
||||||
}
|
}
|
||||||
|
|
||||||
#else /* USE_ISAAC64 */
|
#else /* USE_ISAAC64 */
|
||||||
|
|
||||||
|
/*ARGSUSED*/
|
||||||
static void
|
static void
|
||||||
set_random(seed, fn)
|
set_random(seed, fn)
|
||||||
unsigned long seed;
|
unsigned long seed;
|
||||||
int FDECL((*fn),(int));
|
int FDECL((*fn), (int)) UNUSED;
|
||||||
{
|
{
|
||||||
/* the types are different enough here that sweeping the different
|
/* the types are different enough here that sweeping the different
|
||||||
* routine names into one via #defines is even more confusing
|
* routine names into one via #defines is even more confusing
|
||||||
@@ -886,6 +890,7 @@ int FDECL((*fn),(int));
|
|||||||
# endif
|
# endif
|
||||||
# endif
|
# endif
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* USE_ISAAC64 */
|
#endif /* USE_ISAAC64 */
|
||||||
|
|
||||||
/* An appropriate version of this must always be provided in
|
/* An appropriate version of this must always be provided in
|
||||||
@@ -899,7 +904,7 @@ extern unsigned long NDECL(sys_random_seed);
|
|||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
init_random(fn)
|
init_random(fn)
|
||||||
int FDECL((*fn),(int));
|
int FDECL((*fn), (int));
|
||||||
{
|
{
|
||||||
set_random(sys_random_seed(), fn);
|
set_random(sys_random_seed(), fn);
|
||||||
}
|
}
|
||||||
@@ -907,7 +912,7 @@ int FDECL((*fn),(int));
|
|||||||
/* Reshuffles the random number generator. */
|
/* Reshuffles the random number generator. */
|
||||||
void
|
void
|
||||||
reseed_random(fn)
|
reseed_random(fn)
|
||||||
int FDECL((*fn),(int));
|
int FDECL((*fn), (int));
|
||||||
{
|
{
|
||||||
/* only reseed if we are certain that the seed generation is unguessable
|
/* only reseed if we are certain that the seed generation is unguessable
|
||||||
* by the players. */
|
* by the players. */
|
||||||
|
|||||||
Reference in New Issue
Block a user