From: Michael Beck Date: Wed, 31 Aug 2005 17:24:03 +0000 (+0000) Subject: INT_TO_PTR() and PTR_TO_INT() macros added X-Git-Url: http://nsz.repo.hu/git/?a=commitdiff_plain;h=ac0694db93e562b6cf448185acf698c149210824;p=libfirm INT_TO_PTR() and PTR_TO_INT() macros added [r6551] --- diff --git a/ir/common/irtools.h b/ir/common/irtools.h index 279ab8f89..660b83ea6 100644 --- a/ir/common/irtools.h +++ b/ir/common/irtools.h @@ -14,6 +14,16 @@ #include "irnode.h" +/** + * convert an integer into pointer + */ +#define INT_TO_PTR(v) ((void *)((char *)0 + (v))) + +/** + * convert a pointer into an integer + */ +#define PTR_TO_INT(v) ((int)((char *)(v) - (char *)0)) + /** * The famous clear_link() walker-function. * Do not implement it by yourself, use this one