diff options
author | Tom Gundersen <teg@jklm.no> | 2015-07-16 14:06:11 +0200 |
---|---|---|
committer | Tom Gundersen <teg@jklm.no> | 2015-07-16 14:11:12 +0200 |
commit | cb57dd41595adddb08095298bb1ed258c8ea4877 (patch) | |
tree | 6478f1aa84a405218ab50bc3508b1c39d0de20e2 /src/resolve/resolved-dns-rr.c | |
parent | 443a55981388f519fb6528a8ee042f9e69079b68 (diff) |
bitmap: use external iterator
Reuse the Iterator object from hashmap.h and expose a similar API.
This allows us to do
{
Iterator i;
unsigned n;
BITMAP_FOREACH(n, b, i) {
Iterator j;
unsigned m;
BITMAP_FOREACH(m, b, j) {
...
}
}
}
without getting confused. Requested by David.
Diffstat (limited to 'src/resolve/resolved-dns-rr.c')
-rw-r--r-- | src/resolve/resolved-dns-rr.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/resolve/resolved-dns-rr.c b/src/resolve/resolved-dns-rr.c index e9907eabc0..859b3f7339 100644 --- a/src/resolve/resolved-dns-rr.c +++ b/src/resolve/resolved-dns-rr.c @@ -527,10 +527,11 @@ static int format_timestamp_dns(char *buf, size_t l, time_t sec) { static char *format_types(Bitmap *types) { _cleanup_strv_free_ char **strv = NULL; _cleanup_free_ char *str = NULL; + Iterator i; unsigned type; int r; - BITMAP_FOREACH(type, types) { + BITMAP_FOREACH(type, types, i) { if (dns_type_to_string(type)) { r = strv_extend(&strv, strdup(dns_type_to_string(type))); if (r < 0) |