mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-18 22:36:33 +00:00
bytewriter: fix compiler warning
Some gcc versions warn about bytewriter writing to memory accessed via a const guint8 pointer, despite our explicit cast to guint8 *. Work around that by using an intermediary variable. Fixes #598526.
This commit is contained in:
parent
43b157b775
commit
022970e9f9
1 changed files with 4 additions and 1 deletions
|
@ -437,12 +437,15 @@ gst_byte_writer_ensure_free_space (GstByteWriter * writer, guint size)
|
|||
gboolean \
|
||||
gst_byte_writer_put_##name (GstByteWriter *writer, type val) \
|
||||
{ \
|
||||
guint8 *write_data; \
|
||||
\
|
||||
g_return_val_if_fail (writer != NULL, FALSE); \
|
||||
\
|
||||
if (G_UNLIKELY (!gst_byte_writer_ensure_free_space(writer, bits/8))) \
|
||||
return FALSE; \
|
||||
\
|
||||
write_func ((guint8 *) &writer->parent.data[writer->parent.byte], val); \
|
||||
write_data = (guint8 *) writer->parent.data + writer->parent.byte; \
|
||||
write_func (write_data, val); \
|
||||
writer->parent.byte += bits/8; \
|
||||
writer->parent.size = MAX (writer->parent.size, writer->parent.byte); \
|
||||
\
|
||||
|
|
Loading…
Reference in a new issue