Merge branch 'NetHack-3.6'

# Conflicts:
#	DEVEL/Developer.txt
#	include/config.h
#	include/decl.h
#	include/display.h
#	include/extern.h
#	include/global.h
#	include/hack.h
#	include/patchlevel.h
#	src/display.c
#	src/dothrow.c
#	src/makemon.c
#	src/monst.c
#	src/objnam.c
#	src/sp_lev.c
#	src/wield.c
#	src/zap.c
#	sys/share/pmatchregex.c
#	sys/winnt/Makefile.msc
This commit is contained in:
Bart House
2019-07-14 23:36:56 -07:00
32 changed files with 162 additions and 822 deletions

View File

@@ -572,78 +572,4 @@ VA_DECL(const char *, str)
#endif
}
/* nhassert_failed is called when an nhassert's condition is false */
void
nhassert_failed(filepath, line)
const char * filepath;
int line;
{
const char * filename;
/* attempt to get filename from path. TODO: we really need a port provided
* function to return a filename from a path */
filename = strrchr(filepath, '/');
filename = (filename == NULL ? strrchr(filepath, '\\') : filename);
filename = (filename == NULL ? filepath : filename + 1);
impossible("nhassert failed in file '%s' at line %d", filename, line);
}
static FILE * g_fuzzer_log_file = NULL;
static int g_fuzzer_log_level = LOG_MINIMAL;
/* fuzzer_start() starts the fuzzer opening the fuzzer log file */
void
fuzzer_start()
{
if (!iflags.debug_fuzzer) {
const char * fq_replay;
iflags.debug_fuzzer = TRUE;
iflags.fuzzer_auto_start = FALSE;
nhassert(g_fuzzer_log_file == NULL);
fq_replay = fqname("fuzzer.log", SAVEPREFIX, 0);
g_fuzzer_log_file = fopen(fq_replay, "w");
}
}
/* fuzzer_stop() stops the fuzzer and close the fuzzer log file */
void
fuzzer_stop()
{
if (iflags.debug_fuzzer) {
if(g_fuzzer_log_file != NULL) {
fclose(g_fuzzer_log_file);
g_fuzzer_log_file = NULL;
}
}
}
/* fuzzer_log() is used to place messages in the file 'fuzzer.log'. This
* log is the primary tool for monitoring fuzzer activity and tracking down
* issues that the fuzzer is able to reproduce.
*/
void
fuzzer_log
VA_DECL2(int, lvl, const char *, str)
{
VA_START(str);
VA_INIT(str, char *);
if (!g_fuzzer_log_file)
return;
if (iflags.verbose_logging_start != 0 &&
moves >= iflags.verbose_logging_start)
g_fuzzer_log_level = LOG_VERBOSE;
if (lvl <= g_fuzzer_log_level)
Vfprintf(g_fuzzer_log_file, str, VA_ARGS);
VA_END();
}
/*pline.c*/