[gst-devel] alignment issues
Daniel Gazard
daniel.gazard at free.fr
Mon Apr 12 02:45:09 CEST 2004
"Ronald S. Bultje" <R.S.Bultje at students.uu.nl> writes:
Hi,
> On Wed, 2004-04-07 at 23:08, Daniel Gazard wrote:
> [..]
>
> See attached patch... It's slightly simpler.
Thanks, I had tested your patch and I made a few minor changes.
First I remove the #undef _GET and #undef _PUT. As far as I know, we
cannot undef them because they should be visible by the client code
that use GST_READ/GST_WRITE macros (being visible when
GST_READ/GST_WRITE macros are defined is not necessary). By
consequence, I rename _GET and _PUT in _GST_GET and _GST_PUT to
minimize eventual name clashes.
I replace __data tokens in _GET macros by (__data) to avoid eventual
precedence issues (for example, imagine what happens when __data is
substitute by « ((guint32*) foo) + 4 »).
Then, I substitute the array subscript __size by __idx (I guess it was
a careless mistake) as follow:
-#define _GET(__data, __idx, __size, __shift) \
- (((guint##__size) (((guint8 *) __data)[__size])) << __shift)
+#define _GST_GET(__data, __idx, __size, __shift) \
+ (((guint##__size) (((guint8 *) (__data))[__idx])) << __shift)
The patches are avaible on http://www.epita.fr/~gazard_d/gst-patchs.
I also made two different gst-plugins patchs: one for the alignment
problems and the other to fix the few discussed issues with
GST_DISABLE_LOADSAVE.
-- Daniel
More information about the gstreamer-devel
mailing list