config: Slightly neater configuration table size macros

Macro SHP_TYPE_MAX is the largest possible ship type number.  It is
only used to size mchr[], and we need + 2 there.  Replace by MCHR_SZ
for simplicity.

Same for LND_TYPE_MAX, PLN_TYPE_MAX, P_MAX, and SCT_TYPE_MAX: replace
by LCHR_SZ, PLCHR_SZ, PCHR_SZ, and DCHR_SZ.

Same for N_MAXNUKE, except that one is more than the largest type
number.  Replace by NCHR_SZ.

For consistency, define ICHR_SZ and INTRCHR_SZ for sizing ichr[] and
intrchr_sz[].

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
This commit is contained in:
Markus Armbruster 2020-12-26 06:30:24 +01:00
parent 6bad464348
commit e7583a519e
14 changed files with 31 additions and 30 deletions

View file

@ -28,7 +28,7 @@
*
* Known contributors to this file:
* Dave Pare, 1986
* Markus Armbruster, 2004-2016
* Markus Armbruster, 2004-2020
*/
#ifndef NUKE_H
@ -38,7 +38,6 @@
#include "item.h"
#include "types.h"
#define N_MAXNUKE 20
#define MIN_DRNUKE_CONST 0.001
struct nukstr {
@ -83,7 +82,8 @@ struct nchrstr {
#define putnuke(n, p) ef_write(EF_NUKE, (n), (p))
#define getnukep(n) ((struct nukstr *)ef_ptr(EF_NUKE, (n)))
extern struct nchrstr nchr[N_MAXNUKE + 1];
#define NCHR_SZ 21
extern struct nchrstr nchr[NCHR_SZ];
/* src/lib/common/cargo.c */
extern void nuk_carrier_change(struct nukstr *, int, int, int);