From 9a1fef87fec3007c6791f202308d75690f6bb326 Mon Sep 17 00:00:00 2001 From: Markus Armbruster Date: Sat, 23 Feb 2008 08:03:35 +0100 Subject: [PATCH] Define common get/put macros for empobj This turns existing functions get_empobjp() and put_empobj() into equivalent macros. --- include/empobj.h | 6 ++++-- src/lib/subs/empobj.c | 12 ------------ 2 files changed, 4 insertions(+), 14 deletions(-) diff --git a/include/empobj.h b/include/empobj.h index 364f8e66..97dc00e5 100644 --- a/include/empobj.h +++ b/include/empobj.h @@ -89,9 +89,11 @@ union empobj_storage { struct empobj_chr; +#define get_empobj(type, n, p) ef_read((type), (n), (p)) +#define put_empobj(type, n, p) ef_write((type), (n), (p)) +#define get_empobjp(type, n) ((struct empobj *)ef_ptr((type), (n))) + extern char *obj_nameof(struct empobj *gp); -extern struct empobj *get_empobjp(int type, int id); -extern int put_empobj(int, int, struct empobj *gp); extern struct empobj_chr *get_empobj_chr(struct empobj *gp); extern char *emp_obj_chr_name(struct empobj *gp); extern int get_empobj_mob_max(int type); diff --git a/src/lib/subs/empobj.c b/src/lib/subs/empobj.c index 9df80682..3fb59adf 100644 --- a/src/lib/subs/empobj.c +++ b/src/lib/subs/empobj.c @@ -57,18 +57,6 @@ obj_nameof(struct empobj *gp) return "The Beast #666"; } -struct empobj * -get_empobjp(int type, int id) -{ - return ef_ptr(type, id); -} - -int -put_empobj(int type, int id, struct empobj *gp) -{ - return ef_write(type, id, gp); -} - struct empobj_chr * get_empobj_chr(struct empobj *gp) {