diff --git a/hw/xquartz/X11Application.m b/hw/xquartz/X11Application.m index 584f5bebf..c9cc67ba5 100644 --- a/hw/xquartz/X11Application.m +++ b/hw/xquartz/X11Application.m @@ -1209,11 +1209,6 @@ X11ApplicationMain(int argc, char **argv, char **envp) /* Calculate the height of the menubar so we can avoid it. */ aquaMenuBarHeight = [[NSApp mainMenu] menuBarHeight]; -#if ! __LP64__ - if (!aquaMenuBarHeight) { - aquaMenuBarHeight = [NSMenuView menuBarHeight]; - } -#endif if (!aquaMenuBarHeight) { NSScreen* primaryScreen = [[NSScreen screens] objectAtIndex:0]; aquaMenuBarHeight = NSHeight([primaryScreen frame]) - NSMaxY([primaryScreen visibleFrame]); diff --git a/hw/xquartz/pbproxy/x-selection.m b/hw/xquartz/pbproxy/x-selection.m index f4f4de88e..7e386fc82 100644 --- a/hw/xquartz/pbproxy/x-selection.m +++ b/hw/xquartz/pbproxy/x-selection.m @@ -673,13 +673,8 @@ get_property(Window win, Atom property, struct propdata *pdata, Bool delete, return; } -#ifdef __LP64__ DebugF("pbtypes retainCount after containsObject: %lu\n", [pbtypes retainCount]); -#else - DebugF("pbtypes retainCount after containsObject: %u\n", - [pbtypes retainCount]); -#endif data = [pb stringForType:NSStringPboardType]; @@ -698,11 +693,7 @@ get_property(Window win, Atom property, struct propdata *pdata, Bool delete, if (length < 50) { DebugF("UTF-8: %s\n", bytes); -#ifdef __LP64__ DebugF("UTF-8 length: %lu\n", length); -#else - DebugF("UTF-8 length: %u\n", length); -#endif } } else { @@ -1196,13 +1187,8 @@ get_property(Window win, Atom property, struct propdata *pdata, Bool delete, return; } -#ifdef __LP64__ DebugF("data retainCount before NSBitmapImageRep initWithData: %lu\n", [data retainCount]); -#else - DebugF("data retainCount before NSBitmapImageRep initWithData: %u\n", - [data retainCount]); -#endif bmimage = [[NSBitmapImageRep alloc] initWithData:data]; @@ -1212,13 +1198,8 @@ get_property(Window win, Atom property, struct propdata *pdata, Bool delete, return; } -#ifdef __LP64__ DebugF("data retainCount after NSBitmapImageRep initWithData: %lu\n", [data retainCount]); -#else - DebugF("data retainCount after NSBitmapImageRep initWithData: %u\n", - [data retainCount]); -#endif @try { @@ -1233,13 +1214,8 @@ get_property(Window win, Atom property, struct propdata *pdata, Bool delete, return; } -#ifdef __LP64__ DebugF("bmimage retainCount after TIFFRepresentation %lu\n", [bmimage retainCount]); -#else - DebugF("bmimage retainCount after TIFFRepresentation %u\n", - [bmimage retainCount]); -#endif pbtypes = [NSArray arrayWithObjects:NSTIFFPboardType, nil]; @@ -1256,11 +1232,7 @@ get_property(Window win, Atom property, struct propdata *pdata, Bool delete, [data autorelease]; -#ifdef __LP64__ DebugF("bmimage retainCount before release %lu\n", [bmimage retainCount]); -#else - DebugF("bmimage retainCount before release %u\n", [bmimage retainCount]); -#endif [bmimage autorelease]; } diff --git a/hw/xquartz/quartzKeyboard.c b/hw/xquartz/quartzKeyboard.c index b4cd15868..692f2dd3f 100644 --- a/hw/xquartz/quartzKeyboard.c +++ b/hw/xquartz/quartzKeyboard.c @@ -744,54 +744,6 @@ LegalModifier(unsigned int key, DeviceIntPtr pDev) return 1; } -#if !defined(__LP64__) -static inline UniChar -macroman2ucs(unsigned char c) -{ - /* Precalculated table mapping MacRoman-128 to Unicode. Generated - by creating single element CFStringRefs then extracting the - first character. */ - - static const unsigned short table[128] = { - 0xc4, 0xc5, 0xc7, 0xc9, 0xd1, 0xd6, 0xdc, - 0xe1, - 0xe0, 0xe2, 0xe4, 0xe3, 0xe5, 0xe7, 0xe9, - 0xe8, - 0xea, 0xeb, 0xed, 0xec, 0xee, 0xef, 0xf1, - 0xf3, - 0xf2, 0xf4, 0xf6, 0xf5, 0xfa, 0xf9, 0xfb, - 0xfc, - 0x2020, 0xb0, 0xa2, 0xa3, 0xa7, 0x2022, 0xb6, - 0xdf, - 0xae, 0xa9, 0x2122, 0xb4, 0xa8, 0x2260, 0xc6, - 0xd8, - 0x221e, 0xb1, 0x2264, 0x2265, 0xa5, 0xb5, 0x2202, - 0x2211, - 0x220f, 0x3c0, 0x222b, 0xaa, 0xba, 0x3a9, 0xe6, - 0xf8, - 0xbf, 0xa1, 0xac, 0x221a, 0x192, 0x2248, 0x2206, - 0xab, - 0xbb, 0x2026, 0xa0, 0xc0, 0xc3, 0xd5, 0x152, - 0x153, - 0x2013, 0x2014, 0x201c, 0x201d, 0x2018, 0x2019, 0xf7, - 0x25ca, - 0xff, 0x178, 0x2044, 0x20ac, 0x2039, 0x203a, 0xfb01, - 0xfb02, - 0x2021, 0xb7, 0x201a, 0x201e, 0x2030, 0xc2, 0xca, - 0xc1, - 0xcb, 0xc8, 0xcd, 0xce, 0xcf, 0xcc, 0xd3, - 0xd4, - 0xf8ff, 0xd2, 0xda, 0xdb, 0xd9, 0x131, 0x2c6, - 0x2dc, - 0xaf, 0x2d8, 0x2d9, 0x2da, 0xb8, 0x2dd, 0x2db, - 0x2c7, - }; - - if (c < 128) return c; - else return table[c - 128]; -} -#endif - static KeySym make_dead_key(KeySym in) { @@ -806,10 +758,6 @@ make_dead_key(KeySym in) static Bool QuartzReadSystemKeymap(darwinKeyboardInfo *info) { -#if !defined(__LP64__) - KeyboardLayoutRef key_layout; - int is_uchr = 1; -#endif const void *chr_data = NULL; int num_keycodes = NUM_KEYCODES; UInt32 keyboard_type = LMGetKbdType(); @@ -826,53 +774,8 @@ QuartzReadSystemKeymap(darwinKeyboardInfo *info) currentKeyLayoutRef, kTISPropertyUnicodeKeyLayoutData); if (currentKeyLayoutDataRef) chr_data = CFDataGetBytePtr(currentKeyLayoutDataRef); - } - -#ifdef __clang__ -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wdeprecated-declarations" // KLGetCurrentKeyboardLayout, KLGetKeyboardLayoutProperty -#endif - -#if !defined(__LP64__) - if (chr_data == NULL) { - ErrorF( - "X11.app: Error detected in determining keyboard layout. If you are using an Apple-provided keyboard layout, please report this error at http://xquartz.macosforge.org and http://bugreport.apple.com\n"); - ErrorF( - "X11.app: Debug Info: keyboard_type=%u, currentKeyLayoutRef=%p, currentKeyLayoutDataRef=%p, chr_data=%p\n", - (unsigned)keyboard_type, currentKeyLayoutRef, - currentKeyLayoutDataRef, chr_data); - - KLGetCurrentKeyboardLayout(&key_layout); - KLGetKeyboardLayoutProperty(key_layout, kKLuchrData, &chr_data); - - if (chr_data != NULL) { - ErrorF( - "X11.app: Fallback succeeded, but this is still a bug. Please report the above information.\n"); - } - } - - if (chr_data == NULL) { - ErrorF( - "X11.app: Debug Info: kKLuchrData failed, trying kKLKCHRData.\n"); - ErrorF( - "If you are using a 3rd party keyboard layout, please see http://xquartz.macosforge.org/trac/ticket/154\n"); - KLGetKeyboardLayoutProperty(key_layout, kKLKCHRData, &chr_data); - is_uchr = 0; - num_keycodes = 128; - - if (chr_data != NULL) { - ErrorF( - "X11.app: Fallback succeeded, but this is still a bug. Please report the above information.\n"); - } - } -#endif - -#ifdef __clang__ -#pragma clang diagnostic pop -#endif - - if (currentKeyLayoutRef) CFRelease(currentKeyLayoutRef); + } if (chr_data == NULL) { ErrorF("Couldn't get uchr or kchr resource\n"); @@ -896,9 +799,6 @@ QuartzReadSystemKeymap(darwinKeyboardInfo *info) k = info->keyMap + i * GLYPHS_PER_KEY; for (j = 0; j < 4; j++) { -#if !defined(__LP64__) - if (is_uchr) { -#endif UniChar s[8]; UniCharCount len; UInt32 dead_key_state = 0, extra_dead = 0; @@ -925,42 +825,6 @@ QuartzReadSystemKeymap(darwinKeyboardInfo *info) k[j] = ucs2keysym(s[0]); if (dead_key_state != 0) k[j] = make_dead_key(k[j]); } -#if !defined(__LP64__) - } - else { // kchr - UInt32 c, state = 0, state2 = 0; - UInt16 code; - - code = i | mods[j]; - -#ifdef __clang__ -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wdeprecated-declarations" // KeyTranslate -#endif - - c = KeyTranslate(chr_data, code, &state); - - /* Dead keys are only processed on key-down, so ask - to translate those events. When we find a dead key, - translating the matching key up event will give - us the actual dead character. */ - - if (state != 0) - c = KeyTranslate(chr_data, code | 128, &state2); - -#ifdef __clang__ -#pragma clang diagnostic pop -#endif - - /* Characters seem to be in MacRoman encoding. */ - - if (c != 0 && c != 0x0010) { - k[j] = ucs2keysym(macroman2ucs(c & 255)); - - if (state != 0) k[j] = make_dead_key(k[j]); - } - } -#endif } if (k[3] == k[2]) k[3] = NoSymbol;