[vlc-commits] [Git][videolan/vlc][master] adaptive: replace struct Attribute with class

Steve Lhomme (@robUx4) gitlab at videolan.org
Mon Apr 22 05:41:45 UTC 2024



Steve Lhomme pushed to branch master at VideoLAN / VLC


Commits:
c9afd0cf by Marvin Scholz at 2024-04-22T05:20:11+00:00
adaptive: replace struct Attribute with class

Attribute is a class not a struct, this fixes the following warning in
a number of places:

  warning: struct 'Attribute' was previously declared as a class;
  this is valid, but may result in linker errors under the Microsoft
  C++ ABI [-Wmismatched-tags]

- - - - -


2 changed files:

- modules/demux/adaptive/xml/Node.cpp
- modules/demux/adaptive/xml/Node.h


Changes:

=====================================
modules/demux/adaptive/xml/Node.cpp
=====================================
@@ -81,7 +81,7 @@ bool Node::hasAttribute(const std::string& name) const
 bool Node::hasAttribute(const std::string& name, const std::string &ns) const
 {
     auto it = std::find_if(attributes.cbegin(),attributes.cend(),
-                           [name, ns](const struct Attribute &a)
+                           [name, ns](const class Attribute &a)
                                 {return a.name == name && ns == *a.ns;});
     return it != attributes.cend();
 }
@@ -94,7 +94,7 @@ const std::string& Node::getAttributeValue(const std::string& key) const
 const std::string& Node::getAttributeValue(const std::string& key, const std::string &ns) const
 {
     auto it = std::find_if(attributes.cbegin(),attributes.cend(),
-                           [key, ns](const struct Attribute &a)
+                           [key, ns](const class Attribute &a)
                                 {return a.name == key && ns == *a.ns;});
     if (it != attributes.cend())
         return (*it).value;
@@ -103,7 +103,7 @@ const std::string& Node::getAttributeValue(const std::string& key, const std::st
 
 void Node::addAttribute(const std::string& key, Namespaces::Ptr ns, const std::string& value)
 {
-    struct Attribute attr;
+    class Attribute attr;
     attr.name = key;
     attr.ns = ns;
     attr.value = value;


=====================================
modules/demux/adaptive/xml/Node.h
=====================================
@@ -46,7 +46,7 @@ namespace adaptive
                         bool matches(const std::string &name, const std::string &ns) const;
                 };
 
-                using Attributes = std::vector<struct Attribute>;
+                using Attributes = std::vector<class Attribute>;
 
                 Node            () = delete;
                 Node(std::unique_ptr<std::string>, Namespaces::Ptr);



View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/c9afd0cfa3cbb7dca9cbdcbfdb11784e5867dd79

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/c9afd0cfa3cbb7dca9cbdcbfdb11784e5867dd79
You're receiving this email because of your account on code.videolan.org.


VideoLAN code repository instance


More information about the vlc-commits mailing list