Mercurial > hg > xemacs-beta
changeset 5921:68639fb08af8 cygwin
no obvious 64 vs. 32 pblms in compilation, but still crashing in event-msw
author | Henry Thompson <ht@markup.co.uk> |
---|---|
date | Wed, 23 Apr 2014 22:22:37 +0100 |
parents | 0f2338afbabf |
children | 4b055de36bb9 61d7d7bcbe76 |
files | lib-src/winclient.c notes.txt src/console-msw.c src/dialog-msw.c src/event-msw.c src/frame-msw.c src/glyphs-msw.c src/intl-auto-encap-win32.c src/intl-auto-encap-win32.h src/intl-encap-win32.c src/menubar-msw.c src/toolbar-msw.c src/win32.c |
diffstat | 13 files changed, 215 insertions(+), 47 deletions(-) [+] |
line wrap: on
line diff
--- a/lib-src/winclient.c Mon Apr 21 11:42:50 2014 +0100 +++ b/lib-src/winclient.c Wed Apr 23 22:22:37 2014 +0100 @@ -295,7 +295,7 @@ len++; /* OK. We're connected. Send the message. */ - DdeClientTransaction (buf, len, hConv, NULL, + DdeClientTransaction ((LPBYTE)buf, len, hConv, NULL, 0, XTYP_EXECUTE, TRANSACTION_TIMEOUT, NULL); free (buf);
--- a/notes.txt Mon Apr 21 11:42:50 2014 +0100 +++ b/notes.txt Wed Apr 23 22:22:37 2014 +0100 @@ -61,3 +61,191 @@ but xemacs as such does not: > ./xemacs Fatal error: assertion failed, file event-msw.c, line 4149, !NILP (Vmswindows_frame_being_created) +-------------- +console-msw.c:116:3: warning: format '%ld' expects argument of type +'long int', but argument 3 has type 'DWORD' [-Wformat=] + resolution: cast the DWORDs to long +---- +event-msw.c: In function 'mswindows_wnd_proc': +event-msw.c:2741:6: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast] + ((LCID) GetKeyboardLayout (0) & 0xFFFF), + cast to intptr_t first + +event-msw.c:2825:50: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] + virtual_key = qxeMapVirtualKeyEx (scan, 1, (HKL) lcid); + cast to intptr_t first + ^ +event-msw.c:2839:6: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] + (HKL) lcid); + ^ ditto + +event-msw.c:2861:7: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] + (HKL) lcid); + ^ ditto + +[I _really_ don't understand the size hacking going on between LCIDs + and HKLs here!] +event-msw.c: In function 'emacs_mswindows_remove_timeout': +event-msw.c:4200:6: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] + (void *) id, MECR_DEALLOCATE_EVENT); + ^ + This is a hack!!! Use intptr_t instead, still a hack. + + +frame-msw.c: In function ‘mswindows_init_frame_1’: +frame-msw.c:274:41: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast] + qxeSetWindowLong (hwnd, XWL_FRAMEOBJ, (LONG)STORE_LISP_IN_VOID (frame_obj)); + intptr_t + +frame-msw.c: In function ‘mswindows_get_mouse_position’: +frame-msw.c:554:32: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] + *frame = GET_LISP_FROM_VOID ((void *) qxeGetWindowLong (hwnd, XWL_FRAMEOBJ)); + qxeGetWindowLongPtr (hwnd, XWL_FRAMEOBJ + +frame-msw.c: In function ‘mswindows_get_frame_parent’: +frame-msw.c:822:36: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] + parent = GET_LISP_FROM_VOID ((void *) qxeGetWindowLong (hwnd, XWL_FRAMEOBJ)); + ditto + +glyphs-msw.c: In function 'mswindows_widget_instantiate': +glyphs-msw.c:2261:8: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] + (HMENU)id, /* No menu */ + intptr_t id = -1; + +menubar-msw.c: In function 'empty_menu': +menubar-msw.c:98:24: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast] + #define EMPTY_ITEM_ID ((UINT)STORE_LISP_IN_VOID (Qunbound)) +menubar-msw.c:181:49: note: in expansion of macro 'EMPTY_ITEM_ID' + qxeAppendMenu (menu, MF_STRING | MF_GRAYED, EMPTY_ITEM_ID, + resolved:#define EMPTY_ITEM_ID ((UINT)STORE_LISP_IN_VOID (Qunbound)) + intptr_t + +dialog-msw.c:764:9: warning: passing argument 4 of 'qxeCreateDialogIndirectParam' from incompatible pointer type [enabled by default] + (LPARAM) STORE_LISP_IN_VOID (obj)); + ^ + intptr_t + +toolbar-msw.c: In function 'mswindows_clear_toolbar': +toolbar-msw.c:100:55: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast] + qxeSendMessage (toolbarwnd, TB_GETIMAGELIST, 0, (LONG) &ilist); + ^ + intptr_t +toolbar-msw.c: In function 'mswindows_output_toolbar': +toolbar-msw.c:370:10: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] + (HMENU)(TOOLBAR_ID_BIAS + pos), + ^ + (intptr_t) +In file included from mule-coding.c:32:0: +mule-coding.c: In function 'parse_charset_conversion_specs': + +win32.c: In function 'mswindows_lisp_error_1': +win32.c:259:9: warning: format '%ld' expects argument of type 'long int', but argument 3 has type 'DWORD' [-Wformat=] + errnum, GetLastError ()); + ^ + (long) +win32.c: In function 'Fmswindows_shell_execute': +win32.c:352:11: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast] + ret = (int) qxeShellExecute (NULL, opext, doc, parmext, path, + ^ + intptr-t +win32.c: In function 'setitimer_helper': +win32.c:847:7: warning: passing argument 3 of 'timeSetEvent' from incompatible pointer type [enabled by default] + event_type); + ^ + resoluion: pblm is elsewhere? + setitimer_helper_proc (UINT UNUSED (uID), UINT UNUSED (uMsg), DWORD[_PTR] dwUser, + DWORD[_PTR] UNUSED (dw1), DWORD[_PTR] UNUSED (dw2)) + +> make clean, try again + +/usr/local/src/xemacs-21.5-64bit/lib-src/winclient.c: In function 'doFile': +/usr/local/src/xemacs-21.5-64bit/lib-src/winclient.c:299:4: warning: pointer targ +ets in passing argument 1 of 'DdeClientTransaction' differ in signedness [-Wpoint +er-sign] + 0, XTYP_EXECUTE, TRANSACTION_TIMEOUT, NULL); + ^ +In file included from /usr/local/src/xemacs-21.5-64bit/lib-src/winclient.c:27:0: +/usr/include/w32api/ddeml.h:208:19: note: expected 'LPBYTE' but argument is of ty +pe 'char *' + HDDEDATA WINAPI DdeClientTransaction(LPBYTE pData,DWORD cbData,HCONV hConv,HSZ + hszItem,UINT wFmt,UINT wType,DWORD dwTimeout,LPDWORD pdwResult); + ^ + [note it's arg1 that's the problem, cast to LPBYTE] + +event-msw.c:4200:6: warning: passing argument 4 of 'map_event_chain_remove' makes pointer from integer without a cast [enabled by default] + (intptr_t)id, MECR_DEALLOCATE_EVENT); + ^ +In file included from event-msw.c:72:0: +events.h:956:5: note: expected 'void *' but argument is of type 'long int' + int map_event_chain_remove (int (*fn) (Lisp_Object ev, void *user_data), + resolution: hack, but cast _again_, i.e. (void *)(intptr_t) + +dialog-msw.c:764:9: warning: passing argument 4 of 'qxeCreateDialogIndirectParam' from incompatible pointer type [enabled by default] + (intptr_t) STORE_LISP_IN_VOID (obj)); + ^ +In file included from syswindows.h:642:0, + from console-msw.h:39, + from console-msw-impl.h:37, + from dialog-msw.c:37: +intl-auto-encap-win32.h:627:6: note: expected 'DLGPROC' but argument is of type 'BOOL (*)(struct HWND__ *, UINT, WPARAM, LPARAM)' + HWND qxeCreateDialogIndirectParam (HINSTANCE hInstance, LPCDLGTEMPLATEW lpTemplate, HWND hWndParent, DLGPROC lpDialogFunc, LPARAM dwInitParam); + resolved by adding a cast: (DLGPROC)dialog_proc, but not at all sure +that's right + +> make clean, try again + +intl-win32.c:1509:27: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] + TranslateCharsetInfo ((DWORD *) (DWORD) old_logfont.lfCharSet, &info, + ^ + resolution: do nothing -- I think this is necessary because of + extremely aggressive argument overloading by MS + +intl-auto-encap-win32.c:126:5: warning: passing argument 1 of 'ShellExecuteExA' from incompatible pointer type [enabled by default] + return ShellExecuteExA (pExecInfo); + ^ +In file included from syswindows.h:220:0, + from intl-auto-encap-win32.c:12: +/usr/include/w32api/shellapi.h:345:22: note: expected 'struct SHELLEXECUTEINFOA *' but argument is of type 'struct SHELLEXECUTEINFOW *' + SHSTDAPI_(WINBOOL) ShellExecuteExA (SHELLEXECUTEINFOA *pExecInfo); + ^ + resolution: ignored, never used, removed from intl-encap-win32.c + +intl-auto-encap-win32.c: In function 'qxeFreeEnvironmentStrings': +intl-auto-encap-win32.c:1771:5: warning: passing argument 1 of 'FreeEnvironmentStringsA' from incompatible pointer type [enabled by default] + return FreeEnvironmentStringsA (penv); + ^ +In file included from /usr/include/w32api/winbase.h:28:0, + from /usr/include/w32api/windows.h:70, + from syswindows.h:204, + from intl-auto-encap-win32.c:12: +/usr/include/w32api/processenv.h:29:29: note: expected 'LPCH' but argument is of type 'LPWCH' + WINBASEAPI WINBOOL WINAPI FreeEnvironmentStringsA (LPCH penv); + ^ +intl-encap-win32.c: In function 'qxeUpdateICMRegKey': +intl-encap-win32.c:1426:36: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast] + return UpdateICMRegKeyW (arg1, (DWORD) arg2, (LPWSTR) arg3, arg4); + ^ +intl-encap-win32.c:1426:5: warning: passing argument 2 of 'UpdateICMRegKeyW' makes pointer from integer without a cast [enabled by default] + return UpdateICMRegKeyW (arg1, (DWORD) arg2, (LPWSTR) arg3, arg4); + ^ +In file included from /usr/include/w32api/windows.h:71:0, + from syswindows.h:204, + from console-msw.h:39, + from intl-encap-win32.c:44: +/usr/include/w32api/wingdi.h:3425:28: note: expected 'LPWSTR' but argument is of type 'unsigned int' + WINGDIAPI WINBOOL WINAPI UpdateICMRegKeyW(DWORD reserved,LPWSTR lpszCMID,LPWSTR lpszFileName,UINT command); + resolution: nothing, known problem + +Similarly wrt qxeEnumResourceTypes, qxeEnumResourceNames, +qxeEnumResourceLanguages, qxeImmSetCompositionString + +--------- +make clean, recompile, all looks OK, try to track down the problem -- +the error in event-msw.c inside mswindow_find_frame, inside +intercepted_wnd_proc (a signal handler?), +where we have a +window with no frame saved, appears to happen when the main thread is +in mswindows_init_frame_1 at frame-msw.c:139 + at recompute_all_cached_specifiers_in_frame at specifier.c:3483 + at recompute_one_cached_specifier_in_frame at specifier.c:3444 + around the sixth one
--- a/src/console-msw.c Mon Apr 21 11:42:50 2014 +0100 +++ b/src/console-msw.c Wed Apr 23 22:22:37 2014 +0100 @@ -113,7 +113,7 @@ /* format a "unique" new title */ - sprintf (newtitle, "%ld/%ld", GetTickCount (), GetCurrentProcessId ()); + sprintf (newtitle, "%ld/%ld", (long)GetTickCount (), (long)GetCurrentProcessId ()); /* change current window title; we may be called during armageddon so don't do any conversion */
--- a/src/dialog-msw.c Mon Apr 21 11:42:50 2014 +0100 +++ b/src/dialog-msw.c Wed Apr 23 22:22:37 2014 +0100 @@ -760,8 +760,8 @@ did->hwnd = qxeCreateDialogIndirectParam (NULL, (LPDLGTEMPLATE) Dynarr_begin (template_), - FRAME_MSWINDOWS_HANDLE (f), dialog_proc, - (LPARAM) STORE_LISP_IN_VOID (obj)); + FRAME_MSWINDOWS_HANDLE (f), (DLGPROC)dialog_proc, + (intptr_t) STORE_LISP_IN_VOID (obj)); if (!did->hwnd) /* Something went wrong creating the dialog */ signal_error (Qdialog_box_error, "Creating dialog", keys);
--- a/src/event-msw.c Mon Apr 21 11:42:50 2014 +0100 +++ b/src/event-msw.c Wed Apr 23 22:22:37 2014 +0100 @@ -2738,7 +2738,7 @@ mswindows_locale_to_code_page /* See intl-win32.c for an explanation of the following */ - ((LCID) GetKeyboardLayout (0) & 0xFFFF), + ((LCID) (intptr_t)(GetKeyboardLayout (0)) & 0xFFFF), NULL)); ch = itext_ichar (intchar); xfree (intchar); @@ -2822,7 +2822,7 @@ /* VERY CONFUSING! See intl-win32.c. */ lcid = lcid & 0xFFFF; - virtual_key = qxeMapVirtualKeyEx (scan, 1, (HKL) lcid); + virtual_key = qxeMapVirtualKeyEx (scan, 1, (HKL)(intptr_t) lcid); if (!vk_only) { if (XEUNICODE_P) @@ -2836,7 +2836,7 @@ 0, /* #### what about this flag? "if bit 0 is set, a menu is active???" */ - (HKL) lcid); + (HKL)(intptr_t) lcid); if (tounret > 0) { Ibyte *intchar; @@ -2858,7 +2858,7 @@ 0, /* #### what about this flag? "if bit 0 is set, a menu is active???" */ - (HKL) lcid); + (HKL)(intptr_t) lcid); if (tounret > 0) { /* #### I cannot find proper @@ -4197,7 +4197,7 @@ map_event_chain_remove (remove_timeout_mapper, &mswindows_s_dispatch_event_queue, &mswindows_s_dispatch_event_queue_tail, - (void *) id, MECR_DEALLOCATE_EVENT); + (void *)(intptr_t)id, MECR_DEALLOCATE_EVENT); } /* If `user_p' is false, then return whether there are any win32, timeout,
--- a/src/frame-msw.c Mon Apr 21 11:42:50 2014 +0100 +++ b/src/frame-msw.c Wed Apr 23 22:22:37 2014 +0100 @@ -271,7 +271,7 @@ FRAME_MSWINDOWS_HANDLE (f) = hwnd; - qxeSetWindowLong (hwnd, XWL_FRAMEOBJ, (LONG)STORE_LISP_IN_VOID (frame_obj)); + qxeSetWindowLong (hwnd, XWL_FRAMEOBJ, (intptr_t)STORE_LISP_IN_VOID (frame_obj)); FRAME_MSWINDOWS_DC (f) = GetDC (hwnd); SetTextAlign (FRAME_MSWINDOWS_DC (f), TA_BASELINE | TA_LEFT | TA_NOUPDATECP); @@ -551,7 +551,7 @@ /* Yippie! */ ScreenToClient (hwnd, &pt); - *frame = GET_LISP_FROM_VOID ((void *) qxeGetWindowLong (hwnd, XWL_FRAMEOBJ)); + *frame = GET_LISP_FROM_VOID ((void *) qxeGetWindowLongPtr (hwnd, XWL_FRAMEOBJ)); *x = pt.x; *y = pt.y; return 1; @@ -819,7 +819,7 @@ if (hwnd) { Lisp_Object parent; - parent = GET_LISP_FROM_VOID ((void *) qxeGetWindowLong (hwnd, XWL_FRAMEOBJ)); + parent = GET_LISP_FROM_VOID ((void *) qxeGetWindowLongPtr (hwnd, XWL_FRAMEOBJ)); assert (FRAME_MSWINDOWS_P (XFRAME (parent))); return parent; }
--- a/src/glyphs-msw.c Mon Apr 21 11:42:50 2014 +0100 +++ b/src/glyphs-msw.c Wed Apr 23 22:22:37 2014 +0100 @@ -2225,7 +2225,7 @@ Extbyte *nm = 0; Extbyte *classext; HWND wnd; - int id = 0xffff; + intptr_t id = -1; Lisp_Object gui = IMAGE_INSTANCE_WIDGET_ITEM (ii); Lisp_Gui_Item *pgui = XGUI_ITEM (gui);
--- a/src/intl-auto-encap-win32.c Mon Apr 21 11:42:50 2014 +0100 +++ b/src/intl-auto-encap-win32.c Wed Apr 23 22:22:37 2014 +0100 @@ -116,15 +116,7 @@ return SHFileOperationA ((LPSHFILEOPSTRUCTA) lpFileOp); } -/* NOTE: NT 4.0+ only */ -WINBOOL -qxeShellExecuteEx (SHELLEXECUTEINFOW * pExecInfo) -{ - if (XEUNICODE_P) - return ShellExecuteExW (pExecInfo); - else - return ShellExecuteExA (pExecInfo); -} +/* Error if ShellExecuteEx used: LPSHELLEXECUTEINFO NT 4.0+ only HST: not used, split is broken because of * in declaration in shellapi.h */ /* Error if SHCreateProcessAsUser used: HST: new? -- needs review */ @@ -1762,14 +1754,7 @@ /* Error if SetEnvironmentStrings used: HST: new? -- needs review */ -WINBOOL -qxeFreeEnvironmentStrings (LPWCH penv) -{ - if (XEUNICODE_P) - return FreeEnvironmentStringsW (penv); - else - return FreeEnvironmentStringsA (penv); -} +/* Error if FreeEnvironmentStrings used: HST: needs fancy split, never used */ Extbyte * qxeGetCommandLine (void)
--- a/src/intl-auto-encap-win32.h Mon Apr 21 11:42:50 2014 +0100 +++ b/src/intl-auto-encap-win32.h Wed Apr 23 22:22:37 2014 +0100 @@ -67,11 +67,8 @@ #endif int qxeSHFileOperation (LPSHFILEOPSTRUCTW lpFileOp); -#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED #undef ShellExecuteEx -#define ShellExecuteEx error_use_qxeShellExecuteEx_or_ShellExecuteExA_and_ShellExecuteExW -#endif -WINBOOL qxeShellExecuteEx (SHELLEXECUTEINFOW * pExecInfo); +#define ShellExecuteEx error_LPSHELLEXECUTEINFO_NT_4_0__only_HST__not_used__split_is_broken_because_of___in_declaration_in_shellapi_h_ #undef SHCreateProcessAsUser #define SHCreateProcessAsUser error_HST__new_____needs_review @@ -1275,11 +1272,8 @@ #undef SetEnvironmentStrings #define SetEnvironmentStrings error_HST__new_____needs_review -#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED #undef FreeEnvironmentStrings -#define FreeEnvironmentStrings error_use_qxeFreeEnvironmentStrings_or_FreeEnvironmentStringsA_and_FreeEnvironmentStringsW -#endif -WINBOOL qxeFreeEnvironmentStrings (LPWCH penv); +#define FreeEnvironmentStrings error_HST__needs_fancy_split__never_used #ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED #undef GetCommandLine
--- a/src/intl-encap-win32.c Mon Apr 21 11:42:50 2014 +0100 +++ b/src/intl-encap-win32.c Wed Apr 23 22:22:37 2014 +0100 @@ -623,7 +623,7 @@ // split-simple SHNAMEMAPPING, used in SHFileOperation split SHFileOperation LPSHFILEOPSTRUCT NT 4.0+ only // split-simple SHELLEXECUTEINFO, used in ShellExecuteEx -split ShellExecuteEx LPSHELLEXECUTEINFO NT 4.0+ only +review ShellExecuteEx LPSHELLEXECUTEINFO NT 4.0+ only HST: not used, split is broken because of * in declaration in shellapi.h review SHCreateProcessAsUser HST: new? -- needs review no WinExecError causes link error; NT 4.0+ only begin-bracket !defined (CYGWIN_HEADERS) @@ -1284,7 +1284,7 @@ file PROCESSENV.H yes ExpandEnvironmentStrings -yes FreeEnvironmentStrings +review FreeEnvironmentStrings HST: needs fancy split, never used yes GetCommandLine yes GetCurrentDirectory yes GetEnvironmentVariable
--- a/src/menubar-msw.c Mon Apr 21 11:42:50 2014 +0100 +++ b/src/menubar-msw.c Wed Apr 23 22:22:37 2014 +0100 @@ -95,7 +95,7 @@ /* #### */ #define REPLACE_ME_WITH_GLOBAL_VARIABLE_WHICH_CONTROLS_RIGHT_FLUSH 0 -#define EMPTY_ITEM_ID ((UINT)STORE_LISP_IN_VOID (Qunbound)) +#define EMPTY_ITEM_ID ((intptr_t)STORE_LISP_IN_VOID (Qunbound)) #define EMPTY_ITEM_NAME "(empty)" /* WARNING: uses of this need XETEXT */ /* Current menu (bar or popup) descriptor. gcpro'ed */
--- a/src/toolbar-msw.c Mon Apr 21 11:42:50 2014 +0100 +++ b/src/toolbar-msw.c Wed Apr 23 22:22:37 2014 +0100 @@ -97,7 +97,7 @@ /* finally get rid of the image list assuming it clears up its bitmaps */ - qxeSendMessage (toolbarwnd, TB_GETIMAGELIST, 0, (LONG) &ilist); + qxeSendMessage (toolbarwnd, TB_GETIMAGELIST, 0, (intptr_t) &ilist); if (ilist) { ImageList_Destroy (ilist); @@ -367,7 +367,8 @@ | CCS_ADJUSTABLE, x, y, bar_width, bar_height, FRAME_MSWINDOWS_HANDLE (f), - (HMENU)(TOOLBAR_ID_BIAS + pos), + /* odd param: pointer _or_ integer id . . . */ + (HMENU)(intptr_t)(TOOLBAR_ID_BIAS + pos), NULL, NULL))==NULL) {
--- a/src/win32.c Mon Apr 21 11:42:50 2014 +0100 +++ b/src/win32.c Wed Apr 23 22:22:37 2014 +0100 @@ -256,7 +256,7 @@ if (no_recurse) return emacs_sprintf_string ("Unknown error code %d (error return %ld from FormatMessage())", - errnum, GetLastError ()); + errnum, (long)GetLastError ()); else return emacs_sprintf_string ("Unknown error code %d (error return %s from FormatMessage())", @@ -349,7 +349,7 @@ if (STRINGP (document)) LISP_LOCAL_FILE_FORMAT_MAYBE_URL_TO_TSTR (document, doc); - ret = (int) qxeShellExecute (NULL, opext, doc, parmext, path, + ret = (intptr_t) qxeShellExecute (NULL, opext, doc, parmext, path, (FIXNUMP (show_flag) ? XFIXNUM (show_flag) : SW_SHOWDEFAULT)); } @@ -775,8 +775,8 @@ MMRESULT tid_prof = 0; static void CALLBACK -setitimer_helper_proc (UINT UNUSED (uID), UINT UNUSED (uMsg), DWORD dwUser, - DWORD UNUSED (dw1), DWORD UNUSED (dw2)) +setitimer_helper_proc (UINT UNUSED (uID), UINT UNUSED (uMsg), DWORD_PTR dwUser, + DWORD_PTR UNUSED (dw1), DWORD_PTR UNUSED (dw2)) { /* Just raise the signal indicated by the dwUser parameter */ mswindows_raise (dwUser);