Packets/80211Bundle: Complete radiotap dump (incl. unit-test)
[senf.git] / senf / Packets / PacketImpl.ct
index 7dc7cb9..feb564d 100644 (file)
@@ -35,20 +35,20 @@ senf::detail::AnnotationRegistry::RegistrationProxy<Annotation>
     senf::detail::AnnotationRegistry::Entry<Annotation>::proxy_;
 
 template <class Annotation>
-senf::detail::AnnotationRegistry::key_t
+senf::detail::AnnotationRegistry::key_type
     senf::detail::AnnotationRegistry::Entry<Annotation>::key_;
 
 template <class Annotation>
 prefix_ void * senf::detail::PacketImpl::complexAnnotation()
 {
-    AnnotationRegistry::key_t key (AnnotationRegistry::lookup<Annotation>());
+    AnnotationRegistry::key_type key (AnnotationRegistry::lookup<Annotation>());
     void * rv (complexAnnotation(key));
-#ifndef SENF_PACKET_NO_COMPLEX_ANNOTATIONS
     if (! rv) {
+        while (complexAnnotations_.size() < ComplexAnnotations::size_type(-key))
+            complexAnnotations_.push_back(0);
         complexAnnotations_.replace(-key-1, new AnnotationRegistry::Entry<Annotation>());
         rv = complexAnnotations_[-key-1].get();
     }
-#endif
     return rv;
 }