After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 645595 - bytereader, bytewriter: fix warnings when using inline functions with g++
bytereader, bytewriter: fix warnings when using inline functions with g++
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gstreamer (core)
git master
Other Linux
: Normal normal
: 0.10.33
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2011-03-23 17:21 UTC by Philippe Normand
Modified: 2011-03-23 22:07 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
[gstbyte{read,writ}er] fix build with g++ (1.70 KB, patch)
2011-03-23 17:26 UTC, Philippe Normand
none Details | Review
[gstbyte{read,writ}er] fix build with g++ (1.70 KB, patch)
2011-03-23 17:26 UTC, Philippe Normand
committed Details | Review

Description Philippe Normand 2011-03-23 17:21:34 UTC
g++ complains when compiling a file including:

#include <gst/base/gstbytewriter.h>
#include <gst/base/gstbytereader.h>


.../include/gstreamer-0.10/gst/base/gstbytereader.h: In function ‘guint8* gst_byte_reader_dup_data_unchecked(GstByteReader*, guint)’:
.../include/gstreamer-0.10/gst/base/gstbytereader.h:249:75: error: invalid conversion from ‘void*’ to ‘guint8*’

.../include/gstreamer-0.10/gst/base/gstbytewriter.h: In function ‘gboolean _gst_byte_writer_ensure_free_space_inline(GstByteWriter*, guint)’:
.../include/gstreamer-0.10/gst/base/gstbytewriter.h:196:75: error: invalid conversion from ‘void*’ to ‘guint8*’
Comment 1 Philippe Normand 2011-03-23 17:26:21 UTC
Created attachment 184155 [details] [review]
[gstbyte{read,writ}er] fix build with g++

Added a couple of missing casts reported by g++ when it compiles a
file including the gstbytereader.h and gstbytewriter.h headers.

Fixes
Comment 2 Philippe Normand 2011-03-23 17:26:49 UTC
Created attachment 184156 [details] [review]
[gstbyte{read,writ}er] fix build with g++

Added a couple of missing casts reported by g++ when it compiles a
file including the gstbytereader.h and gstbytewriter.h headers.

Fixes
Comment 3 Tim-Philipp Müller 2011-03-23 20:32:39 UTC
Didn't I fix this already?

commit 6c2741941804f8297d2073fa173fe44bdd99d7ec
Author: Tim-Philipp Müller <tim.muller@collabora.co.uk>
Date:   Sat Mar 12 16:58:01 2011 +0000

    bytereader, bytewriter: fix up inline functions to make g++ happy
    
    gstbytereader.h: In function ‘guint8* gst_byte_reader_dup_data_unchecked(GstByteReader*, guint)’:
    gstbytereader.h:249:75: error: invalid conversion from ‘void*’ to ‘guint8*’
    gstbytewriter.h: In function ‘gboolean _gst_byte_writer_ensure_free_space_inline(GstByteWriter*, guint)’:
    gstbytewriter.h:196:75: error: invalid conversion from ‘void*’ to ‘guint8*’
Comment 4 Tim-Philipp Müller 2011-03-23 20:33:50 UTC
Oh nevermind, this is in a branch, never cherry-picked those into master.
Comment 5 Tim-Philipp Müller 2011-03-23 20:56:05 UTC
Since it's a trivial patch, I took the liberty of just cherry-picking the one I had already instead of applying yours (less work, I'm lazy). Hope you don't mind..

 commit f9558b163fab74d97a747823d2abede31f343871
 Author: Tim-Philipp Müller <tim.muller@collabora.co.uk>
 Date:   Sat Mar 12 17:01:39 2011 +0000

    tests: add libscpp unit test to make sure g++ likes our library headers

 commit 5300a5e73b1c20958e3a348003e750d5be50930c
 Author: Tim-Philipp Müller <tim.muller@collabora.co.uk>
 Date:   Sat Mar 12 16:58:01 2011 +0000

    bytereader, bytewriter: fix up inline functions to make g++ happy
    
    gstbytereader.h: In function ‘guint8* gst_byte_reader_dup_data_unchecked(GstByteReader*, guint)’:
    gstbytereader.h:249:75: error: invalid conversion from ‘void*’ to ‘guint8*’
    gstbytewriter.h: In function ‘gboolean _gst_byte_writer_ensure_free_space_inline(GstByteWriter*, guint)’:
    gstbytewriter.h:196:75: error: invalid conversion from ‘void*’ to ‘guint8*’
    
    https://bugzilla.gnome.org/show_bug.cgi?id=645595
Comment 6 Philippe Normand 2011-03-23 22:07:24 UTC
No problem as long as the issue is fixed, thanks Tim.