[gstreamer-bugs] [Bug 584678] New: Miscast of a pointer in gstglwindow_win32.c
GStreamer (bugzilla.gnome.org)
bugzilla-daemon at bugzilla.gnome.org
Tue Jun 2 18:21:10 PDT 2009
If you have any questions why you received this email, please see the text at
the end of this email. Replies to this email are NOT read, please see the text
at the end of this email. You can add comments to this bug at:
http://bugzilla.gnome.org/show_bug.cgi?id=584678
GStreamer | gst-plugins-gl | Ver: git
Summary: Miscast of a pointer in gstglwindow_win32.c
Product: GStreamer
Version: git
Platform: Other
OS/Version: Windows
Status: UNCONFIRMED
Severity: normal
Priority: Normal
Component: gst-plugins-gl
AssignedTo: gstreamer-bugs at lists.sourceforge.net
ReportedBy: lrn1986 at gmail.com
QAContact: gstreamer-bugs at lists.sourceforge.net
GNOME version: Unspecified
GNOME milestone: Unspecified
GCC 4.4.0 complains:
gstglwindow_win32.c: In function 'gst_gl_window_set_external_window_id':
gstglwindow_win32.c:207: error: cast from pointer to integer of different size
The offending line is:
SetWindowLongPtr ((HWND) id, GWL_WNDPROC, (DWORD) (guint64) sub_class_proc);
Prototype for SetWindowLongPtr is:
WINUSERAPI LONG_PTR WINAPI SetWindowLongPtrW(HWND,int,LONG_PTR); (on x64)
or
WINUSERAPI LONG WINAPI SetWindowLongW(HWND,int,LONG); (on x86)
In MinGW LONG_PTR is defined as
typedef __int64 LONG_PTR, *PLONG_PTR; (on x64)
or as
typedef long LONG_PTR, *PLONG_PTR; (on x86)
and LONG is defined as
typedef long LONG;
So, on x86 systems the SetWindowLongPtr accepts LONG, LONG_PTR being equivalent
to LONG, while on x64 systems it accepts LONG_PTR itself. Both DWORD and
guint64 are out of place.
In case you're wondering, MSDN says that
typedef __int3264 LONG_PTR;
which is the same thing.
How to fix:
replace "(DWORD) (guint64)" with "(LONG_PTR)"
--
See http://bugzilla.gnome.org/page.cgi?id=email.html for more info about why you received
this email, why you can't respond via email, how to stop receiving
emails (or reduce the number you receive), and how to contact someone
if you are having problems with the system.
You can add comments to this bug at http://bugzilla.gnome.org/show_bug.cgi?id=584678.
More information about the Gstreamer-bugs
mailing list