]> git.pond.sub.org Git - empserver/blobdiff - src/lib/subs/snxtitem.c
New macro ARRAY_SIZE()
[empserver] / src / lib / subs / snxtitem.c
index da14e9a84d43aed2f15c015ee68e16b1d14007e3..6cdd02b8275f1335b0e07ea065ba6d38969b9582 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *  Empire - A multi-player, client/server Internet based war game.
- *  Copyright (C) 1986-2017, Dave Pare, Jeff Bailey, Thomas Ruschak,
+ *  Copyright (C) 1986-2020, Dave Pare, Jeff Bailey, Thomas Ruschak,
  *                Ken Stevens, Steve McClure, Markus Armbruster
  *
  *  Empire is free software: you can redistribute it and/or modify
@@ -28,7 +28,7 @@
  *
  *  Known contributors to this file:
  *     Dave Pare, 1989
- *     Markus Armbruster, 2009-2011
+ *     Markus Armbruster, 2009-2020
  */
 
 #include <config.h>
@@ -218,7 +218,7 @@ snxtitem_list(struct nstr_item *np, int type, int *list, int len)
 
 /*
  * Initialize @np to iterate over the items of type @type in a carrier.
- * The carrier has file type @carrier_type and uid @carrier_uid.
+ * The carrier has file type @carrier_type and UID @carrier_uid.
  * Note: you can take an item gotten with nxtitem() off its carrier
  * without disturbing the iterator.  Whether the iterator will pick up
  * stuff you load onto the carrier during iteration is unspecified.
@@ -241,7 +241,7 @@ snxtitem_use_condarg(struct nstr_item *np)
 
     if (!player->condarg)
        return 1;
-    n = nstr_comp(np->cond, sizeof(np->cond) / sizeof(*np->cond),
+    n = nstr_comp(np->cond, ARRAY_SIZE(np->cond),
                  np->type, player->condarg);
     if (n < 0)
        return 0;