aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHugo Hörnquist <hugo@lysator.liu.se>2019-02-15 18:48:24 +0100
committerHugo Hörnquist <hugo@lysator.liu.se>2019-02-15 20:03:45 +0100
commitc528ed79f0a359ddfeb3905be07018e668b418a8 (patch)
treebfbf806a2e203e24c1c0b288049eb77ba05325cb
parentImprove FOR macro. (diff)
downloadcalp-c528ed79f0a359ddfeb3905be07018e668b418a8.tar.gz
calp-c528ed79f0a359ddfeb3905be07018e668b418a8.tar.xz
Remove repeat information in invocation of FOR macro.
-rw-r--r--graphs.c6
-rw-r--r--linked_list.inc.h2
-rw-r--r--macro.h8
-rw-r--r--vcal.c2
4 files changed, 9 insertions, 9 deletions
diff --git a/graphs.c b/graphs.c
index ff23be00..2ed7009e 100644
--- a/graphs.c
+++ b/graphs.c
@@ -107,7 +107,7 @@ int trie_to_dot_helper ( TRIE_NODE(T)* root, FILE* f ) {
#if 1 /* Toggle values */
if (L(root) != NULL) {
- FOR(LLIST(content_set), content_set, v, &L(root)->val) {
+ FOR(LLIST, content_set, v, &L(root)->val) {
char buf[0x100];
FMT(strbuf)(&v->key, buf);
fprintf(f, "\"%p\" [label=\"%s\" shape=rectangle color=darkgreen];\n",
@@ -115,14 +115,14 @@ int trie_to_dot_helper ( TRIE_NODE(T)* root, FILE* f ) {
fprintf(f, "\"%p\" -> \"%p\";\n", root, v);
/* Parameters */
- FOR(LLIST(param_set), param_set, p, &v->val) {
+ FOR(LLIST, param_set, p, &v->val) {
strbuf* param_key = &p->key;
fprintf(f, "\"%p\" [label=\"%s\" color=blue];\n",
param_key, param_key->mem);
fprintf(f, "\"%p\" -> \"%p\";", p, param_key);
- FOR(LLIST(strbuf), strbuf, str, &p->val) {
+ FOR(LLIST, strbuf, str, &p->val) {
fprintf(f, "\"%p\" [label=\"%s\" color=orange];",
str, str->mem);
fprintf(f, "\"%p\" -> \"%p\";", param_key, str);
diff --git a/linked_list.inc.h b/linked_list.inc.h
index 6102720a..cdb0ac1a 100644
--- a/linked_list.inc.h
+++ b/linked_list.inc.h
@@ -168,7 +168,7 @@ int RESET(LLIST(TYPE)) ( LLIST(TYPE)* llist ) {
FMT_F(LLIST(TYPE)) {
int seek = 0;
fmtf("(");
- FOR(LLIST(TYPE), TYPE, v, this) {
+ FOR(LLIST, TYPE, v, this) {
seek += FMT(TYPE)(v, buf + seek);
fmtf(" ");
}
diff --git a/macro.h b/macro.h
index 0057df25..5762eee6 100644
--- a/macro.h
+++ b/macro.h
@@ -83,10 +83,10 @@
/* Iterator macros. */
#define FOR(CONT_T, T, var, set) \
- PRE_FOR_ ## CONT_T (T, var, set); \
- for( BEG_ ## CONT_T (T, var, set); \
- END_ ## CONT_T (T, var, set); \
- NXT_ ## CONT_T (T, var, set))
+ PRE_FOR_ ## CONT_T (T) (T, var, set); \
+ for( BEG_ ## CONT_T (T) (T, var, set); \
+ END_ ## CONT_T (T) (T, var, set); \
+ NXT_ ## CONT_T (T) (T, var, set))
/* Example int implementation
* FOR(int, i, 10) { } */
diff --git a/vcal.c b/vcal.c
index dda509db..3961d5d6 100644
--- a/vcal.c
+++ b/vcal.c
@@ -122,7 +122,7 @@ FMT_F(vcomponent) {
seek += sprintf(buf + seek, _RESET);
seek += FMT(TRIE(content_line))(&this->clines, buf + seek);
seek += sprintf(buf + seek, "\nComponents:\n");
- FOR(VECT(vcomponent), vcomponent, comp, &this->components) {
+ FOR(VECT, vcomponent, comp, &this->components) {
seek += FMT(vcomponent)(comp, buf + seek);
}