INT_TO_PTR() and PTR_TO_INT() macros added
authorMichael Beck <beck@ipd.info.uni-karlsruhe.de>
Wed, 31 Aug 2005 17:24:03 +0000 (17:24 +0000)
committerMichael Beck <beck@ipd.info.uni-karlsruhe.de>
Wed, 31 Aug 2005 17:24:03 +0000 (17:24 +0000)
[r6551]

ir/common/irtools.h

index 279ab8f..660b83e 100644 (file)
 
 #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