aboutsummaryrefslogtreecommitdiffstats
path: root/embed
diff options
context:
space:
mode:
authorMarco Pesenti Gritti <marco@it.gnome.org>2003-02-16 05:29:07 +0800
committerMarco Pesenti Gritti <mpeseng@src.gnome.org>2003-02-16 05:29:07 +0800
commit34ac853507e9f8527250df9ff7598e6b54e43f8d (patch)
tree444130fa103bde37b81fe39eb3ee41aea57dc1b3 /embed
parent669cb390f319c44540df27839b8a628bcd54bc90 (diff)
downloadgsoc2013-epiphany-34ac853507e9f8527250df9ff7598e6b54e43f8d.tar
gsoc2013-epiphany-34ac853507e9f8527250df9ff7598e6b54e43f8d.tar.gz
gsoc2013-epiphany-34ac853507e9f8527250df9ff7598e6b54e43f8d.tar.bz2
gsoc2013-epiphany-34ac853507e9f8527250df9ff7598e6b54e43f8d.tar.lz
gsoc2013-epiphany-34ac853507e9f8527250df9ff7598e6b54e43f8d.tar.xz
gsoc2013-epiphany-34ac853507e9f8527250df9ff7598e6b54e43f8d.tar.zst
gsoc2013-epiphany-34ac853507e9f8527250df9ff7598e6b54e43f8d.zip
fix casting on big-endian, from galeon.
2003-02-15 Marco Pesenti Gritti <marco@it.gnome.org> * embed/mozilla/EventContext.cpp: fix casting on big-endian, from galeon.
Diffstat (limited to 'embed')
-rw-r--r--embed/mozilla/EventContext.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/embed/mozilla/EventContext.cpp b/embed/mozilla/EventContext.cpp
index 78a01e451..7e07e757b 100644
--- a/embed/mozilla/EventContext.cpp
+++ b/embed/mozilla/EventContext.cpp
@@ -527,7 +527,12 @@ nsresult EventContext::GetMouseEventInfo (EphyEmbedEvent *info)
nsresult result;
nsIDOMMouseEvent *aMouseEvent = (nsIDOMMouseEvent*)mEvent;
- aMouseEvent->GetButton ((PRUint16*)&info->mouse_button);
+ /* casting 32-bit guint* to PRUint16* below will break on big-endian */
+ PRUint16 btn;
+ aMouseEvent->GetButton (&btn);
+ info->mouse_button = (guint)btn;
+
+ /* OTOH, casting only between (un)signedness is safe */
aMouseEvent->GetScreenX ((PRInt32*)&info->mouse_x);
aMouseEvent->GetScreenY ((PRInt32*)&info->mouse_y);