-/* NetHack 3.6 options.c $NHDT-Date: 1575245078 2019/12/02 00:04:38 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.391 $ */
+/* NetHack 3.6 options.c $NHDT-Date: 1578971391 2020/01/14 03:09:51 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.394 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/*-Copyright (c) Michael Allison, 2008. */
/* NetHack may be freely redistributed. See license for details. */
#define PILE_LIMIT_DFLT 5
-static char empty_optstr[] = {0};
+static char empty_optstr[] = { '\0' };
/*
* NOTE: If you add (or delete) an option, please update the short
config_error_add("Unknown %s parameter '%s'", fullname, opts);
return FALSE;
}
- if (opttype > 0 && (op = string_for_opt(opts, FALSE)) != empty_optstr) {
+ if (opttype > 0
+ && (op = string_for_opt(opts, FALSE)) != empty_optstr) {
wc_set_font_name(opttype, op);
#ifdef MAC
set_font_name(opttype, op);
if (match_optname(opts, "fruit", 2, TRUE)) {
struct fruit *forig = 0;
- char empty_str = '\0';
if (duplicate)
complain_about_duplicate(opts, 1);
}
if (op == empty_optstr)
return FALSE;
- /* stripped leading and trailing spaces, condensed internal ones in 3.6.2 */
+ /* strip leading/trailing spaces, condense internal ones (3.6.2) */
mungspaces(op);
if (!initial) {
struct fruit *f;
if (duplicate)
complain_about_duplicate(opts, 1);
op = string_for_opt(opts, negated);
- if ((negated && op == empty_optstr) || (!negated && op != empty_optstr))
+ if ((negated && op == empty_optstr)
+ || (!negated && op != empty_optstr))
flags.pile_limit = negated ? 0 : atoi(op);
else if (negated) {
bad_negation(fullname, TRUE);
}
/* "disclose" without a value means "all with prompting"
and negated means "none without prompting" */
- if (op == empty_optstr || !strcmpi(op, "all") || !strcmpi(op, "none")) {
+ if (op == empty_optstr
+ || !strcmpi(op, "all") || !strcmpi(op, "none")) {
if (op != empty_optstr && !strcmpi(op, "none"))
negated = TRUE;
for (num = 0; num < NUM_DISCLOSURE_OPTIONS; num++)
if (duplicate)
complain_about_duplicate(opts, 1);
op = string_for_opt(opts, negated);
- if ((negated && op == empty_optstr) || (!negated && op != empty_optstr)) {
+ if ((negated && op == empty_optstr)
+ || (!negated && op != empty_optstr)) {
iflags.wc_scroll_amount = negated ? 1 : atoi(op);
} else if (negated) {
bad_negation(fullname, TRUE);
if (duplicate)
complain_about_duplicate(opts, 1);
op = string_for_opt(opts, negated);
- if ((negated && op == empty_optstr) || (!negated && op != empty_optstr)) {
+ if ((negated && op == empty_optstr)
+ || (!negated && op != empty_optstr)) {
iflags.wc_scroll_margin = negated ? 5 : atoi(op);
} else if (negated) {
bad_negation(fullname, TRUE);
if (duplicate)
complain_about_duplicate(opts, 1);
op = string_for_opt(opts, negated);
- if ((negated && op == empty_optstr) || (!negated && op != empty_optstr)) {
+ if ((negated && op == empty_optstr)
+ || (!negated && op != empty_optstr)) {
iflags.wc_tile_width = negated ? 0 : atoi(op);
} else if (negated) {
bad_negation(fullname, TRUE);
if (duplicate)
complain_about_duplicate(opts, 1);
op = string_for_opt(opts, negated);
- if ((negated && op == empty_optstr) || (!negated && op != empty_optstr)) {
+ if ((negated && op == empty_optstr)
+ || (!negated && op != empty_optstr)) {
iflags.wc_tile_height = negated ? 0 : atoi(op);
} else if (negated) {
bad_negation(fullname, TRUE);
if (duplicate)
complain_about_duplicate(opts, 1);
op = string_for_opt(opts, negated);
- if ((negated && op == empty_optstr) || (!negated && op != empty_optstr)) {
+ if ((negated && op == empty_optstr)
+ || (!negated && op != empty_optstr)) {
iflags.wc_vary_msgcount = negated ? 0 : atoi(op);
} else if (negated) {
bad_negation(fullname, TRUE);
bad_negation(fullname, FALSE);
retval = FALSE;
- /* this just checks atol() sanity, not logical window size sanity */
+ /* just checks atol() sanity, not logical window size sanity */
} else if (ltmp <= 0L || ltmp >= (long) LARGEST_INT) {
config_error_add("Invalid %s: %ld", fullname, ltmp);
retval = FALSE;