From c528ed79f0a359ddfeb3905be07018e668b418a8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hugo=20H=C3=B6rnquist?= Date: Fri, 15 Feb 2019 18:48:24 +0100 Subject: Remove repeat information in invocation of FOR macro. --- graphs.c | 6 +++--- linked_list.inc.h | 2 +- macro.h | 8 ++++---- vcal.c | 2 +- 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); } -- cgit v1.2.3