Mercurial > MadButterfly
diff src/mb_types.h @ 140:0de8fd11271e
Use macro to simplify the code.
Many code snippets are repeated annoying. Just because we manipulate
a common structure of data. They are move to macros to make it
simple and meaning.
author | Thinker K.F. Li <thinker@branda.to> |
---|---|
date | Tue, 23 Sep 2008 08:28:14 +0800 |
parents | 1695a4b02b14 |
children | d11aa8fc06c7 |
line wrap: on
line diff
--- a/src/mb_types.h Mon Sep 22 19:22:57 2008 +0800 +++ b/src/mb_types.h Tue Sep 23 08:28:14 2008 +0800 @@ -168,7 +168,8 @@ #define sh_get_mouse_event_subject(sh) ((sh)->geo->mouse_event) #define sh_hide(sh) do { (sh)->geo->flags |= GEF_HIDDEN; } while(0) #define sh_show(sh) do { (sh)->geo->flags &= ~GEF_HIDDEN; } while(0) -extern void sh_attach_coord(shape_t *sh, coord_t *coord); -extern void sh_detach_coord(shape_t *sh); +#define sh_attach_coord(sh, coord) do { (sh)->coord = coord; } while(0) +#define sh_detach_coord(sh) do { (sh)->coord = NULL; } while(0) + #endif /* __MB_TYPES_H_ */