From 7e474afa325d52fe5aac738fd285f1b80724ad32 Mon Sep 17 00:00:00 2001 From: Markus Armbruster Date: Sun, 13 Aug 2006 07:18:11 +0000 Subject: [PATCH] (obj_nameof): Return safer error value. (get_empobjp, get_empobj_chr, emp_obj_chr_name, get_empobj_mob_max): Style. --- src/lib/common/empobj.c | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/src/lib/common/empobj.c b/src/lib/common/empobj.c index 03041fad8..214310646 100644 --- a/src/lib/common/empobj.c +++ b/src/lib/common/empobj.c @@ -54,7 +54,7 @@ obj_nameof(struct empobj *gp) return prnuke((struct nukstr *)gp); } CANT_REACH(); - return ""; + return "The Beast #666"; } struct empobj * @@ -62,8 +62,7 @@ get_empobjp(int type, int id) { if (CANT_HAPPEN(type == EF_SECTOR || type == EF_BAD)) return NULL; - else - return (struct empobj *)ef_ptr(type, id); + return ef_ptr(type, id); } int @@ -96,9 +95,8 @@ get_empobj_chr(struct empobj *gp) return &nchr[(int)gp->type]; case EF_SECTOR: return &dchr[(int)gp->type]; - default: - CANT_REACH(); } + CANT_REACH(); return NULL; } @@ -116,9 +114,8 @@ emp_obj_chr_name(struct empobj *gp) return nchr[(int)gp->type].n_name; case EF_SECTOR: return dchr[(int)gp->type].d_name; - default: - CANT_REACH(); } + CANT_REACH(); return NULL; } @@ -134,8 +131,7 @@ get_empobj_mob_max(int type) return plane_mob_max; case EF_SECTOR: return sect_mob_max; - default: - CANT_REACH(); } + CANT_REACH(); return -1; } -- 2.43.0