Community
Participate
Working Groups
In SWT we have some cases where Windows packs two signed short values into a four byte integer. For example, when the mouse is moved, the x and y coordinates are packed in this manner. We need to extract these as two signed integers. We use the pattern shown below which is reported as an unneccessary cast. From Widget: boolean sendMouseEvent (int type, int button, int count, int detail, boolean send, int hwnd, int msg, int wParam, int lParam) { if (!hooks (type) && !filters (type)) return true; Event event = new Event (); event.button = button; event.detail = detail; event.count = count; event.x = (short) (lParam & 0xFFFF); event.y = (short) (lParam >> 16); setInputState (event, type); mapEvent (hwnd, event); if (send) { sendEvent (type, event); if (isDisposed ()) return false; } else { postEvent (type, event); } return event.doit; }
Looks like a dup of bug 116647.
Indeed, this is the same problem. Closing as dup of bug 116647. *** This bug has been marked as a duplicate of 116647 ***