Make sector types signed

get_empobj_chr() and emp_obj_chr_name() access struct sctstr member
sct_type through struct empobj member type.  This is technically
non-portable, because the two differ in signedness.  It was also
undocumented.  Fix by making sct_type signed.  sct_newtype as well,
for consistency.

map_char() uses unsigned char for a sector type argument.  Change that
to int.  Matches how this is done elsewhere.
This commit is contained in:
Markus Armbruster 2008-02-22 20:58:37 +01:00
parent c36cae7a64
commit 74e873e96c
4 changed files with 8 additions and 7 deletions

View file

@ -54,7 +54,7 @@
#include "xy.h"
static int bmnxtsct(struct nstr_sect *);
static char map_char(unsigned char type, natid own, int owner_or_god);
static char map_char(int type, natid own, int owner_or_god);
int
do_map(int bmap, int unit_type, char *arg, char *map_flags_arg)
@ -330,7 +330,7 @@ bmnxtsct(struct nstr_sect *np)
* If OWNER_OR_GOD, the map is for the sector's owner or a deity.
*/
static char
map_char(unsigned char type, natid own, int owner_or_god)
map_char(int type, natid own, int owner_or_god)
{
if (CANT_HAPPEN(type > SCT_TYPE_MAX || !dchr[type].d_mnem))
return '?';