list: make our list macros a bit easier to use by not requring type spec on each invocation

We can determine the list entry type via the typeof() gcc construct, and
so we should to make the macros much shorter to use.
This commit is contained in:
Lennart Poettering
2013-10-14 06:11:19 +02:00
parent 14bf2c9d37
commit 71fda00f32
38 changed files with 153 additions and 157 deletions
+2 -2
View File
@@ -332,7 +332,7 @@ int main(int argc, char *argv[]) {
log_uptime();
LIST_HEAD_INIT(struct list_sample_data, head);
LIST_HEAD_INIT(head);
/* main program loop */
for (samples = 0; !exiting && samples < arg_samples_len; samples++) {
@@ -406,7 +406,7 @@ int main(int argc, char *argv[]) {
/* calculate how many samples we lost and scrap them */
arg_samples_len -= (int)(newint_ns / interval);
}
LIST_PREPEND(struct list_sample_data, link, head, sampledata);
LIST_PREPEND(link, head, sampledata);
}
/* do some cleanup, close fd's */
+1 -1
View File
@@ -81,7 +81,7 @@ static void svg_header(void) {
struct list_sample_data *sampledata_last;
sampledata = head;
LIST_FIND_TAIL(struct list_sample_data, link, sampledata, head);
LIST_FIND_TAIL(link, sampledata, head);
sampledata_last = head;
LIST_FOREACH_BEFORE(link, sampledata, head) {
sampledata_last = sampledata;