projects
/
libfirm
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
feba559
)
Add the famous ENDOF() macro which calculates the address of the one past last elemen...
author
Christoph Mallon
<christoph.mallon@gmx.de>
Thu, 27 Sep 2007 12:08:12 +0000
(12:08 +0000)
committer
Christoph Mallon
<christoph.mallon@gmx.de>
Thu, 27 Sep 2007 12:08:12 +0000
(12:08 +0000)
[r15942]
ir/common/irtools.h
patch
|
blob
|
history
diff --git
a/ir/common/irtools.h
b/ir/common/irtools.h
index
2367fc5
..
a5d7f26
100644
(file)
--- a/
ir/common/irtools.h
+++ b/
ir/common/irtools.h
@@
-41,6
+41,10
@@
lc_opt_entry_t *firm_opt_get_root(void);
#define MAX(x, y) ((x) > (y) ? (x) : (y))
#define MIN(x, y) ((x) < (y) ? (x) : (y))
#define MAX(x, y) ((x) > (y) ? (x) : (y))
#define MIN(x, y) ((x) < (y) ? (x) : (y))
+/* calculate the address of the one past last element of an array whose size is
+ * known statically */
+#define ENDOF(x) ((x) + sizeof(x) / sizeof(*(x)))
+
/**
* Three valued compare as demanded by e.g. qsort(3)
* @param c A number.
/**
* Three valued compare as demanded by e.g. qsort(3)
* @param c A number.