Add padding to structures and objects
authorDavid Schleef <ds@schleef.org>
Tue, 7 Oct 2003 21:58:42 +0000 (21:58 +0000)
committerDavid Schleef <ds@schleef.org>
Tue, 7 Oct 2003 21:58:42 +0000 (21:58 +0000)
Original commit message from CVS:
Add padding to structures and objects

26 files changed:
gst/gstautoplug.h
gst/gstbin.h
gst/gstbuffer.h
gst/gstbytestream.h
gst/gstclock.h
gst/gstdata.h
gst/gstelement.h
gst/gstevent.h
gst/gstindex.h
gst/gstinterface.h
gst/gstobject.h
gst/gstpad.h
gst/gstpipeline.h
gst/gstplugin.h
gst/gstpluginfeature.h
gst/gstqueue.h
gst/gstregistry.h
gst/gstscheduler.h
gst/gstsystemclock.h
gst/gstthread.h
gst/gsttype.h
gst/gsttypefind.h
gst/gsttypes.h
gst/gsturi.h
gst/gstxml.h
plugins/elements/gstqueue.h

index 0fae435..504ad6e 100644 (file)
@@ -54,6 +54,8 @@ typedef enum {
 
 struct _GstAutoplug {
   GstObject object;
+
+  GST_OBJECT_PADDING
 };
 
 struct _GstAutoplugClass {
@@ -65,6 +67,8 @@ struct _GstAutoplugClass {
   /* perform the autoplugging */
   GstElement* (*autoplug_to_caps) (GstAutoplug *autoplug, GstCaps *srccaps, GstCaps *sinkcaps, va_list args);
   GstElement* (*autoplug_to_renderers) (GstAutoplug *autoplug, GstCaps *srccaps, GstElement *target, va_list args);
+
+  GST_CLASS_PADDING
 };
 
 
index 5c81c6f..a665271 100644 (file)
@@ -82,7 +82,7 @@ struct _GstBin {
   gpointer                 pre_iterate_data;
   gpointer                 post_iterate_data;
 
-  gpointer      dummy[8];
+  GST_OBJECT_PADDING
 };
 
 struct _GstBinClass {
@@ -101,7 +101,7 @@ struct _GstBinClass {
   void         (*element_added)        (GstBin *bin, GstElement *child);
   void         (*element_removed)      (GstBin *bin, GstElement *child);
 
-  gpointer      dummy[8];
+  GST_CLASS_PADDING
 };
 
 GType          gst_bin_get_type                (void);
index aaa732b..4191f7b 100644 (file)
@@ -108,6 +108,8 @@ struct _GstBuffer {
   GstBufferPool                *pool;
   /* pointer to pool private data of parent buffer in case of a subbuffer */
   gpointer              pool_private;
+
+  GST_STRUCT_PADDING
 };
 
 /* bufferpools */
@@ -131,6 +133,8 @@ struct _GstBufferPool {
   GstBufferPoolBufferFreeFunction      buffer_free;
 
   gpointer                             user_data;
+
+  GST_STRUCT_PADDING
 };
 
 /* allocation */
index 3191d08..82ac0ec 100644 (file)
@@ -47,6 +47,8 @@ struct _GstByteStream {
 
   /* if we are in the seek state (waiting for DISCONT) */
   gboolean      in_seek;
+
+  GST_OBJECT_PADDING
 };
 
 GstByteStream*         gst_bytestream_new              (GstPad *pad);
index 9968e04..1e17ceb 100644 (file)
@@ -137,7 +137,7 @@ struct _GstClock {
   GCond                *active_cond;
   gboolean      stats;
 
-  gpointer      dummy[4];
+  GST_OBJECT_PADDING
 };
 
 struct _GstClockClass {
@@ -158,6 +158,8 @@ struct _GstClockClass {
   GstClockEntryStatus   (*wait_async)           (GstClock *clock, GstClockEntry *entry);
   void                  (*unschedule)          (GstClock *clock, GstClockEntry *entry);
   void                  (*unlock)              (GstClock *clock, GstClockEntry *entry);
+
+  GST_CLASS_PADDING
 };
 
 GType                  gst_clock_get_type              (void);
index a3d2495..c329ec9 100644 (file)
@@ -26,6 +26,7 @@
 
 #include <glib-object.h>
 #include <gst/gstatomic.h>
+#include <gst/gsttypes.h>
 
 G_BEGIN_DECLS
 
@@ -73,6 +74,8 @@ struct _GstData {
   /* utility function pointers, can override default */
   GstDataFreeFunction   free;          /* free the data */
   GstDataCopyFunction   copy;          /* copy the data */
+
+  GST_STRUCT_PADDING
 };
 
 /* function used by subclasses only */
index 1a4f997..352391f 100644 (file)
@@ -166,7 +166,7 @@ struct _GstElement {
   GAsyncQueue          *prop_value_queue;
   GMutex               *property_mutex;
 
-  gpointer             dummy[8];
+  GST_OBJECT_PADDING
 };
 
 struct _GstElementClass {
@@ -218,8 +218,7 @@ struct _GstElementClass {
   GstIndex*            (*get_index)            (GstElement *element);
   void                 (*set_index)            (GstElement *element, GstIndex *index);
 
-  /* padding */
-  gpointer             dummy[8];
+  GST_CLASS_PADDING
 };
 
 void                   gst_element_class_add_pad_template      (GstElementClass *klass, GstPadTemplate *templ);
@@ -360,6 +359,8 @@ struct _GstElementDetails {
   gchar *version;               /* version of the element */
   gchar *author;                /* who wrote this thing? */
   gchar *copyright;             /* copyright details (year, etc.) */
+
+  GST_STRUCT_PADDING
 };
 
 #define GST_TYPE_ELEMENT_FACTORY               (gst_element_factory_get_type())
@@ -386,10 +387,14 @@ struct _GstElementFactory {
 
   GList *padtemplates;
   guint16 numpadtemplates;
+
+  GST_OBJECT_PADDING
 };
 
 struct _GstElementFactoryClass {
   GstPluginFeatureClass parent_class;
+
+  GST_CLASS_PADDING
 };
 
 GType                  gst_element_factory_get_type            (void);
index 4e2c1aa..5ed32ee 100644 (file)
@@ -184,6 +184,8 @@ struct _GstEvent {
       GstCaps          *caps;
     } caps;
   } event_data;
+
+  GST_STRUCT_PADDING
 };
 
 void           _gst_event_initialize           (void);
index 8f423cc..aa05ace 100644 (file)
@@ -168,7 +168,7 @@ struct _GstIndex {
   GHashTable           *writers;
   gint                  last_id;
 
-  gpointer              dummy[8];
+  GST_OBJECT_PADDING
 };
 
 struct _GstIndexClass {
@@ -189,7 +189,7 @@ struct _GstIndexClass {
   /* signals */
   void         (*entry_added)          (GstIndex *index, GstIndexEntry *entry);
 
-  gpointer              dummy[8];
+  GST_CLASS_PADDING;
 };
 
 GType                  gst_index_get_type              (void);
@@ -251,10 +251,14 @@ struct _GstIndexFactory {
            
   gchar *longdesc;            /* long description of the index (well, don't overdo it..) */
   GType type;                 /* unique GType of the index */
+
+  GST_OBJECT_PADDING
 };
 
 struct _GstIndexFactoryClass {
   GstPluginFeatureClass parent; 
+
+  GST_CLASS_PADDING
 };
 
 GType                  gst_index_factory_get_type      (void);
index 137b6cc..bd11637 100644 (file)
@@ -52,6 +52,8 @@ typedef struct _GstInterfaceClass {
   /* virtual functions */
   gboolean (* supported) (GstInterface *iface,
                          GType         iface_type);
+
+  GST_CLASS_PADDING
 } GstInterfaceClass;
 
 #define GST_INTERFACE_CHECK_INSTANCE_CAST(obj, type, cast_t) \
index 9e99346..d8d1ebb 100644 (file)
@@ -76,6 +76,8 @@ struct _GstObject {
   GstObject    *parent;
 
   guint32      flags;
+
+  GST_OBJECT_PADDING
 };
 
 /* signal_object is used to signal to the whole class */
@@ -97,7 +99,7 @@ struct _GstObjectClass {
   xmlNodePtr   (*save_thyself)         (GstObject *object, xmlNodePtr parent);
   void         (*restore_thyself)      (GstObject *object, xmlNodePtr self);
 
-  gpointer     dummy[4];
+  GST_CLASS_PADDING
 };
 
 #define GST_FLAGS(obj)                 (GST_OBJECT_CAST (obj)->flags)
index d335f53..6859b58 100644 (file)
@@ -172,10 +172,14 @@ struct _GstPad {
   gpointer             element_private;
 
   GstPadTemplate       *padtemplate;   /* the template for this pad */
+
+  GST_OBJECT_PADDING
 };
 
 struct _GstPadClass {
   GstObjectClass parent_class;
+
+  GST_CLASS_PADDING
 };
 
 struct _GstRealPad {
@@ -216,6 +220,8 @@ struct _GstRealPad {
   GstPadBufferPoolFunction      bufferpoolfunc;
 
   GstProbeDispatcher            probedisp;
+
+  GST_OBJECT_PADDING
 };
 
 struct _GstRealPadClass {
@@ -226,16 +232,22 @@ struct _GstRealPadClass {
 
   void                 (*linked)               (GstPad *pad, GstPad *peer);
   void                 (*unlinked)             (GstPad *pad, GstPad *peer);
+
+  GST_CLASS_PADDING
 };
 
 struct _GstGhostPad {
   GstPad pad;
 
   GstRealPad *realpad;
+
+  GST_OBJECT_PADDING
 };
 
 struct _GstGhostPadClass {
   GstPadClass parent_class;
+
+  GST_CLASS_PADDING
 };
 
 
@@ -321,6 +333,8 @@ struct _GstPadTemplate {
   GstPadDirection  direction;
   GstPadPresence   presence;
   GstCaps        *caps;
+
+  GST_OBJECT_PADDING
 };
 
 struct _GstPadTemplateClass {
@@ -328,6 +342,8 @@ struct _GstPadTemplateClass {
 
   /* signal callbacks */
   void (*pad_created)  (GstPadTemplate *templ, GstPad *pad);
+
+  GST_CLASS_PADDING
 };
 
 #ifdef G_HAVE_ISO_VARARGS
index 986cee1..99a4564 100644 (file)
@@ -43,13 +43,13 @@ typedef struct _GstPipelineClass GstPipelineClass;
 struct _GstPipeline {
   GstBin        bin;
 
-  gpointer      dummy[32];
+  GST_OBJECT_PADDING
 };
 
 struct _GstPipelineClass {
   GstBinClass parent_class;
 
-  gpointer      dummy[32];
+  GST_CLASS_PADDING
 };
 
 GType          gst_pipeline_get_type           (void);
index 48d646e..2bbe593 100644 (file)
@@ -57,6 +57,8 @@ struct _GstPlugin {
   gpointer      manager;               /* managing registry */
   GModule      *module;                /* contains the module if the plugin is loaded */
   gboolean      init_called;           /* if the init function has been called */
+
+  GST_STRUCT_PADDING
 };
 
 /* Initialiser function: returns TRUE if plugin initialised successfully */
index c8082e5..23f614a 100644 (file)
@@ -25,6 +25,7 @@
 #define __GST_PLUGIN_FEATURE_H__
 
 #include <glib-object.h>
+#include <gst/gsttypes.h>
 
 G_BEGIN_DECLS
 
@@ -48,12 +49,16 @@ struct _GstPluginFeature {
 
   /* --- private --- */
   gpointer      manager;
+
+  GST_OBJECT_PADDING
 };
 
 struct _GstPluginFeatureClass {
   GObjectClass parent_class;
 
   void          (*unload_thyself)      (GstPluginFeature *feature);
+
+  GST_CLASS_PADDING
 };
 
 typedef struct {
index 2cd55f3..e7ee592 100644 (file)
@@ -85,6 +85,8 @@ struct _GstQueue {
 
   GTimeVal *timeval;   /* the timeout for the queue locking */
   GAsyncQueue *events; /* upstream events get decoupled here */
+
+  GST_OBJECT_PADDING
 };
 
 struct _GstQueueClass {
@@ -92,6 +94,8 @@ struct _GstQueueClass {
 
   /* signal callbacks */
   void (*full)         (GstQueue *queue);
+
+  GST_CLASS_PADDING
 };
 
 GType gst_queue_get_type (void);
index f639ef3..7889ef3 100644 (file)
@@ -86,7 +86,7 @@ struct _GstRegistry {
 
   GList        *paths;
 
-  gpointer      dummy[8];
+  GST_OBJECT_PADDING
 };
 
 struct _GstRegistryClass {
@@ -105,7 +105,7 @@ struct _GstRegistryClass {
   /* signals */
   void                         (*plugin_added)         (GstRegistry *registry, GstPlugin *plugin);
 
-  gpointer      dummy[8];
+  GST_CLASS_PADDING
 };
 
 
index 7ab80ac..21c4214 100644 (file)
@@ -72,7 +72,7 @@ struct _GstScheduler {
 
   GList                        *schedulers;
 
-  gpointer             dummy[8];
+  GST_OBJECT_PADDING
 };
 
 struct _GstSchedulerClass {
@@ -105,7 +105,7 @@ struct _GstSchedulerClass {
   void                  (*object_sync)          (GstScheduler *sched, GstClock *clock, GstObject *object,
                                                 GstClockID id);
 
-  gpointer             dummy[8];
+  GST_CLASS_PADDING
 };
 
 GType                  gst_scheduler_get_type          (void);
@@ -160,10 +160,14 @@ struct _GstSchedulerFactory {
 
   gchar *longdesc;              /* long description of the scheduler (well, don't overdo it..) */
   GType type;                  /* unique GType of the scheduler */
+
+  GST_OBJECT_PADDING
 };
 
 struct _GstSchedulerFactoryClass {
   GstPluginFeatureClass parent;
+
+  GST_CLASS_PADDING
 };
 
 GType                  gst_scheduler_factory_get_type          (void);
index 204e8bc..5f4170b 100644 (file)
@@ -44,10 +44,14 @@ struct _GstSystemClock {
 
   GMutex *      mutex;
   GCond *       cond;
+
+  GST_OBJECT_PADDING
 };
 
 struct _GstSystemClockClass {
   GstClockClass  parent_class;
+
+  GST_CLASS_PADDING
 };
 
 GType                  gst_system_clock_get_type       (void);
index 432bd4e..50aee24 100644 (file)
@@ -65,7 +65,7 @@ struct _GstThread {
   GMutex       *lock;                  /* thread lock/condititon pairs */
   GCond        *cond;                  /* used to control the thread */
 
-  gpointer      dummy[8];
+  GST_OBJECT_PADDING
 };
 
 struct _GstThreadClass {
@@ -74,7 +74,7 @@ struct _GstThreadClass {
   /* signals */
   void (*shutdown)     (GstThread *thread);
 
-  gpointer      dummy[8];
+  GST_CLASS_PADDING
 };
 
 GType  gst_thread_get_type     (void);
index 9a3365a..434b67f 100644 (file)
@@ -45,6 +45,8 @@ struct _GstType {
   gchar *exts;                 /* space-delimited list of extensions */
 
   GSList *factories;           /* factories providing this type */
+
+  GST_STRUCT_PADDING
 };
 
 struct _GstTypeDefinition {
@@ -68,13 +70,13 @@ struct _GstTypeFactory {
   gchar                *exts;
   GstTypeFindFunc       typefindfunc;
 
-  gpointer              dummy[8];
+  GST_OBJECT_PADDING
 };
 
 struct _GstTypeFactoryClass {
   GstPluginFeatureClass parent;
 
-  gpointer             dummy[8];
+  GST_CLASS_PADDING
 };
 
 
index 9067138..0085eb0 100644 (file)
@@ -50,6 +50,8 @@ struct _GstTypeFind {
   GstByteStream *bs;
 
   GstCaps      *caps;
+
+  GST_OBJECT_PADDING
 };
 
 struct _GstTypeFindClass {
@@ -58,6 +60,8 @@ struct _GstTypeFindClass {
   /* signals */
   void                         (*have_type)    (GstElement *element,
                                         GstCaps    *caps);
+
+  GST_CLASS_PADDING
 };
 
 GType gst_type_find_get_type (void);
index bf8f6b5..81e4b87 100644 (file)
@@ -58,6 +58,10 @@ typedef enum {
   GST_RESULT_NOT_IMPL
 } GstResult;
 
+#define GST_STRUCT_PADDING  gpointer _gst_reserved[4];
+#define GST_CLASS_PADDING   gpointer _gst_reserved[4];
+#define GST_OBJECT_PADDING  gpointer _gst_reserved[4];
+
 G_END_DECLS
 
 #endif /* __GST_TYPES_H__ */
index 7980fd0..2662b47 100644 (file)
@@ -49,10 +49,14 @@ struct _GstURIHandler {
   gchar *longdesc;         /* description of the uri */
   gchar *element;          /* The element that can handle this uri */
   gchar *property;         /* The property on the element to set the uri */
+
+  GST_OBJECT_PADDING
 };
 
 struct _GstURIHandlerClass {
   GstPluginFeatureClass parent;
+
+  GST_CLASS_PADDING
 };
 
 GType                  gst_uri_handler_get_type        (void);
index 5e9772e..25bb32e 100644 (file)
@@ -48,6 +48,8 @@ struct _GstXML {
   GList      *topelements;
 
   xmlNsPtr ns;
+
+  GST_OBJECT_PADDING
 };
 
 typedef struct _GstXMLNs GstXMLNs;
@@ -58,6 +60,8 @@ struct _GstXMLClass {
   /* signal callbacks */
   void (*object_loaded)         (GstXML *xml, GstObject *object, xmlNodePtr self);
   void (*object_saved)          (GstXML *xml, GstObject *object, xmlNodePtr self);
+
+  GST_CLASS_PADDING
 };
 
 GType          gst_xml_get_type        (void);
index 2cd55f3..e7ee592 100644 (file)
@@ -85,6 +85,8 @@ struct _GstQueue {
 
   GTimeVal *timeval;   /* the timeout for the queue locking */
   GAsyncQueue *events; /* upstream events get decoupled here */
+
+  GST_OBJECT_PADDING
 };
 
 struct _GstQueueClass {
@@ -92,6 +94,8 @@ struct _GstQueueClass {
 
   /* signal callbacks */
   void (*full)         (GstQueue *queue);
+
+  GST_CLASS_PADDING
 };
 
 GType gst_queue_get_type (void);