Bug 121635 - [compiler] Necessary cast marked as unnecessary
Summary: [compiler] Necessary cast marked as unnecessary
Status: RESOLVED DUPLICATE of bug 116647
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.2   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Philipe Mulet CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-12-20 16:39 EST by Veronika Irvine CLA
Modified: 2006-01-03 09:58 EST (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Veronika Irvine CLA 2005-12-20 16:39:54 EST
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;
}
Comment 1 Markus Keller CLA 2006-01-03 06:36:11 EST
Looks like a dup of bug 116647.
Comment 2 Olivier Thomann CLA 2006-01-03 09:58:38 EST
Indeed, this is the same problem.
Closing as dup of bug 116647.

*** This bug has been marked as a duplicate of 116647 ***