An iterator over attributes, as GCC scalarizes it the code is equivalent
authorMichael Matz <matz@suse.de>
Tue, 30 Oct 2007 01:19:17 +0000 (01:19 +0000)
committerMichael Matz <matz@suse.de>
Tue, 30 Oct 2007 01:19:17 +0000 (01:19 +0000)
commitc05e6639c5b7ce9ab1dc1a63197ff20c6ebb7526
treec7abe5d0bb40467a4d2e08c27eb7a0a3cb56199d
parent745364a439d10f15a6e5cf3ec2e3ee6f60dda123
An iterator over attributes, as GCC scalarizes it the code is equivalent
to hand-written code that doesn't use a structure:

attr_iterator ai;
FOR_ATTRS (store, entry, &ai)
  {
    do_something (ai.name, ai.type);
    switch (ai.type)
    {
      case ATTR_STRING:   ai.as_string; break;
      case ATTR_INT:      ai.as_int;    break;
      case ATTR_LOCALIDS: iterate (ai.as_numlist); break;
    }
  }
tools/attr_store.c
tools/attr_store.h
tools/attr_store_p.h
tools/dumpattr.c