Bug 226022 - Compiler warnings in N20080406-0200
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/graphics/TextLayout.java b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/graphics/TextLayout.java
index 08ffecf..22d8ca3 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/graphics/TextLayout.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/graphics/TextLayout.java
@@ -2807,8 +2807,8 @@
*/
if (device.logFontsCache == null) device.logFontsCache = new LOGFONT[device.scripts.length];
final LOGFONT newLogFont = OS.IsUnicode ? (LOGFONT)new LOGFONTW () : new LOGFONTA ();
- Object object = new Object () {
- public int EnumFontFamExProc(int lpelfe, int lpntme, int FontType, int lParam) {
+ class EnumFontFamEx {
+ int EnumFontFamExProc(int lpelfe, int lpntme, int FontType, int lParam) {
OS.MoveMemory(newLogFont, lpelfe, LOGFONT.sizeof);
if (FontType == OS.RASTER_FONTTYPE) return 1;
newLogFont.lfHeight = logFont.lfHeight;
@@ -2829,6 +2829,9 @@
return 1;
}
};
+ EnumFontFamEx object = new EnumFontFamEx();
+ /* Avoid compiler warnings */
+ if (false) object.EnumFontFamExProc(0, 0, 0, 0);
Callback callback = new Callback(object, "EnumFontFamExProc", 4);
int /*long*/ address = callback.getAddress();
if (address == 0) SWT.error(SWT.ERROR_NO_MORE_CALLBACKS);