(shp_maxno): Variable's value is well-known constant N_MAXSHIPS + 1.

Useless, remove.  Users changed to check mchr's sentinel, because
that's clearer than comparing the index to N_MAXSHIPS or sizeof(mchr)
/ sizeof(*mchr).

(mchr): Change sentinel's m_name to NULL.
This commit is contained in:
Markus Armbruster 2005-11-06 21:20:49 +00:00
parent 47192c9079
commit e23d8a8fac
5 changed files with 4 additions and 15 deletions

View file

@ -49,16 +49,14 @@ global_init(void)
init_pchr();
init_mchr();
init_plchr();
/* the same thing should be done for units... */
}
static void
init_mchr(void)
{
struct mchrstr *mp;
int n;
for (mp = mchr, n = 0; n < shp_maxno; n++, mp++) {
for (mp = mchr; mp->m_name; mp++) {
if (mp->m_nxlight)
mp->m_flags |= M_XLIGHT;
if (mp->m_nchoppers)
@ -74,7 +72,6 @@ static void
init_plchr(void)
{
struct plchrstr *pp;
int pcount;
for (pp = plchr; pp->pl_name; pp++) {
if (pp->pl_flags & P_M)

View file

@ -205,8 +205,6 @@ struct mchrstr mchr[] = {
360, 1500, M_SUPPLY, 0, 2},
{{0},
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "",
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, NULL,
0, 0, 0, 0, 0}
};
int shp_maxno = (sizeof(mchr) / sizeof(struct mchrstr)) - 1;