[vlc-commits] include: move vlc_common_members to <vlc_objects.h>

Rémi Denis-Courmont git at videolan.org
Mon Dec 11 18:09:57 CET 2017


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Mon Dec 11 18:46:01 2017 +0200| [2eff4fa1227ba7ec513d21e27ce8e748121eb38d] | committer: Rémi Denis-Courmont

include: move vlc_common_members to <vlc_objects.h>

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=2eff4fa1227ba7ec513d21e27ce8e748121eb38d
---

 include/vlc_common.h  | 72 ---------------------------------------------------
 include/vlc_objects.h | 68 ++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 68 insertions(+), 72 deletions(-)

diff --git a/include/vlc_common.h b/include/vlc_common.h
index a677d0dc19..88aef3330a 100644
--- a/include/vlc_common.h
+++ b/include/vlc_common.h
@@ -408,78 +408,6 @@ typedef int ( * vlc_list_callback_t ) ( vlc_object_t *,      /* variable's objec
 #include "vlc_mtime.h"
 #include "vlc_threads.h"
 
-/**
- * Common structure members
- *****************************************************************************/
-
-/**
- * VLC object common members
- *
- * Common public properties for all VLC objects.
- * Object also have private properties maintained by the core, see
- * \ref vlc_object_internals_t
- */
-struct vlc_common_members
-{
-    /** Object type name
-     *
-     * A constant string identifying the type of the object (for logging)
-     */
-    const char *object_type;
-
-    /** Log messages header
-     *
-     * Human-readable header for log messages. This is not thread-safe and
-     * only used by VLM and Lua interfaces.
-     */
-    char *header;
-
-    int  flags;
-
-    /** Module probe flag
-     *
-     * A boolean during module probing when the probe is "forced".
-     * See \ref module_need().
-     */
-    bool force;
-
-    /** LibVLC instance
-     *
-     * Root VLC object of the objects tree that this object belongs in.
-     */
-    libvlc_int_t *libvlc;
-
-    /** Parent object
-     *
-     * The parent VLC object in the objects tree. For the root (the LibVLC
-     * instance) object, this is NULL.
-     */
-    vlc_object_t *parent;
-};
-
-/**
- * Backward compatibility macro
- */
-#define VLC_COMMON_MEMBERS struct vlc_common_members obj;
-
-/**
- * Type-safe vlc_object_t cast
- *
- * This macro attempts to cast a pointer to a compound type to a
- * \ref vlc_object_t pointer in a type-safe manner.
- * It checks if the compound type actually starts with an embedded
- * \ref vlc_object_t structure.
- */
-#if !defined(__cplusplus)
-# define VLC_OBJECT(x) \
-    _Generic((x)->obj, \
-        struct vlc_common_members: (vlc_object_t *)(&(x)->obj), \
-        const struct vlc_common_members: (const vlc_object_t *)(&(x)->obj) \
-    )
-#else
-# define VLC_OBJECT( x ) ((vlc_object_t *)&(x)->obj)
-#endif
-
 /*****************************************************************************
  * Macros and inline functions
  *****************************************************************************/
diff --git a/include/vlc_objects.h b/include/vlc_objects.h
index 3da6820bfd..8f85885f1f 100644
--- a/include/vlc_objects.h
+++ b/include/vlc_objects.h
@@ -28,6 +28,74 @@
  * Common VLC object defintions
  */
 
+/**
+ * VLC object common members
+ *
+ * Common public properties for all VLC objects.
+ * Object also have private properties maintained by the core, see
+ * \ref vlc_object_internals_t
+ */
+struct vlc_common_members
+{
+    /** Object type name
+     *
+     * A constant string identifying the type of the object (for logging)
+     */
+    const char *object_type;
+
+    /** Log messages header
+     *
+     * Human-readable header for log messages. This is not thread-safe and
+     * only used by VLM and Lua interfaces.
+     */
+    char *header;
+
+    int  flags;
+
+    /** Module probe flag
+     *
+     * A boolean during module probing when the probe is "forced".
+     * See \ref module_need().
+     */
+    bool force;
+
+    /** LibVLC instance
+     *
+     * Root VLC object of the objects tree that this object belongs in.
+     */
+    libvlc_int_t *libvlc;
+
+    /** Parent object
+     *
+     * The parent VLC object in the objects tree. For the root (the LibVLC
+     * instance) object, this is NULL.
+     */
+    vlc_object_t *parent;
+};
+
+/**
+ * Backward compatibility macro
+ */
+#define VLC_COMMON_MEMBERS struct vlc_common_members obj;
+
+/**
+ * Type-safe vlc_object_t cast
+ *
+ * This macro attempts to cast a pointer to a compound type to a
+ * \ref vlc_object_t pointer in a type-safe manner.
+ * It checks if the compound type actually starts with an embedded
+ * \ref vlc_object_t structure.
+ */
+#if !defined(__cplusplus)
+# define VLC_OBJECT(x) \
+    _Generic((x)->obj, \
+        struct vlc_common_members: (vlc_object_t *)(&(x)->obj), \
+        const struct vlc_common_members: (const vlc_object_t *)(&(x)->obj) \
+    )
+#else
+# define VLC_OBJECT( x ) ((vlc_object_t *)&(x)->obj)
+#endif
+
 /* Object flags */
 #define OBJECT_FLAGS_QUIET       0x0002
 #define OBJECT_FLAGS_NOINTERACT  0x0004



More information about the vlc-commits mailing list