Mercurial > hg > xemacs-beta
comparison src/device-x.c @ 4528:726060ee587c g++-warning-removal-2008-10-28
First draft of g++ 4.3 warning removal patch. Builds. *Needs ChangeLogs.*
author | Stephen J. Turnbull <stephen@xemacs.org> |
---|---|
date | Wed, 29 Oct 2008 04:06:33 +0900 |
parents | fc7067b7f407 |
children | b0d2ace4aed1 |
comparison
equal
deleted
inserted
replaced
4524:03ba50f7ecd7 | 4528:726060ee587c |
---|---|
77 /* The application class of Emacs. */ | 77 /* The application class of Emacs. */ |
78 Lisp_Object Vx_emacs_application_class; | 78 Lisp_Object Vx_emacs_application_class; |
79 | 79 |
80 Lisp_Object Vx_initial_argv_list; /* #### ugh! */ | 80 Lisp_Object Vx_initial_argv_list; /* #### ugh! */ |
81 | 81 |
82 /* Shut up G++ 4.3. */ | |
83 #define Xrm_ODR(option,resource,type,default) \ | |
84 { (String) option, (String) resource, type, default } | |
85 | |
82 static XrmOptionDescRec emacs_options[] = | 86 static XrmOptionDescRec emacs_options[] = |
83 { | 87 { |
84 {"-geometry", ".geometry", XrmoptionSepArg, NULL}, | 88 Xrm_ODR ("-geometry", ".geometry", XrmoptionSepArg, NULL), |
85 {"-iconic", ".iconic", XrmoptionNoArg, "yes"}, | 89 Xrm_ODR ("-iconic", ".iconic", XrmoptionNoArg, (String) "yes"), |
86 | 90 |
87 {"-internal-border-width", "*EmacsFrame.internalBorderWidth", XrmoptionSepArg, NULL}, | 91 Xrm_ODR ("-internal-border-width", "*EmacsFrame.internalBorderWidth", XrmoptionSepArg, NULL), |
88 {"-ib", "*EmacsFrame.internalBorderWidth", XrmoptionSepArg, NULL}, | 92 Xrm_ODR ("-ib", "*EmacsFrame.internalBorderWidth", XrmoptionSepArg, NULL), |
89 {"-scrollbar-width", "*EmacsFrame.scrollBarWidth", XrmoptionSepArg, NULL}, | 93 Xrm_ODR ("-scrollbar-width", "*EmacsFrame.scrollBarWidth", XrmoptionSepArg, NULL), |
90 {"-scrollbar-height", "*EmacsFrame.scrollBarHeight", XrmoptionSepArg, NULL}, | 94 Xrm_ODR ("-scrollbar-height", "*EmacsFrame.scrollBarHeight", XrmoptionSepArg, NULL), |
91 | 95 |
92 {"-privatecolormap", ".privateColormap", XrmoptionNoArg, "yes"}, | 96 Xrm_ODR ("-privatecolormap", ".privateColormap", XrmoptionNoArg, (String) "yes"), |
93 {"-visual", ".EmacsVisual", XrmoptionSepArg, NULL}, | 97 Xrm_ODR ("-visual", ".EmacsVisual", XrmoptionSepArg, NULL), |
94 | 98 |
95 /* #### Beware! If the type of the shell changes, update this. */ | 99 /* #### Beware! If the type of the shell changes, update this. */ |
96 {"-T", "*TopLevelEmacsShell.title", XrmoptionSepArg, NULL}, | 100 Xrm_ODR ("-T", "*TopLevelEmacsShell.title", XrmoptionSepArg, NULL), |
97 {"-wn", "*TopLevelEmacsShell.title", XrmoptionSepArg, NULL}, | 101 Xrm_ODR ("-wn", "*TopLevelEmacsShell.title", XrmoptionSepArg, NULL), |
98 {"-title", "*TopLevelEmacsShell.title", XrmoptionSepArg, NULL}, | 102 Xrm_ODR ("-title", "*TopLevelEmacsShell.title", XrmoptionSepArg, NULL), |
99 | 103 |
100 {"-iconname", "*TopLevelEmacsShell.iconName", XrmoptionSepArg, NULL}, | 104 Xrm_ODR ("-iconname", "*TopLevelEmacsShell.iconName", XrmoptionSepArg, NULL), |
101 {"-in", "*TopLevelEmacsShell.iconName", XrmoptionSepArg, NULL}, | 105 Xrm_ODR ("-in", "*TopLevelEmacsShell.iconName", XrmoptionSepArg, NULL), |
102 {"-mc", "*pointerColor", XrmoptionSepArg, NULL}, | 106 Xrm_ODR ("-mc", "*pointerColor", XrmoptionSepArg, NULL), |
103 {"-cr", "*cursorColor", XrmoptionSepArg, NULL}, | 107 Xrm_ODR ("-cr", "*cursorColor", XrmoptionSepArg, NULL), |
104 {"-fontset", "*FontSet", XrmoptionSepArg, NULL}, | 108 Xrm_ODR ("-fontset", "*FontSet", XrmoptionSepArg, NULL), |
105 }; | 109 }; |
106 | 110 |
107 static const struct memory_description x_device_data_description_1 [] = { | 111 static const struct memory_description x_device_data_description_1 [] = { |
108 { XD_LISP_OBJECT, offsetof (struct x_device, x_keysym_map_hash_table) }, | 112 { XD_LISP_OBJECT, offsetof (struct x_device, x_keysym_map_hash_table) }, |
109 { XD_LISP_OBJECT, offsetof (struct x_device, WM_COMMAND_frame) }, | 113 { XD_LISP_OBJECT, offsetof (struct x_device, WM_COMMAND_frame) }, |
327 return argv[i+1]; | 331 return argv[i+1]; |
328 | 332 |
329 if (argc > 0 && argv[0] && *argv[0]) | 333 if (argc > 0 && argv[0] && *argv[0]) |
330 return (ptr = strrchr (argv[0], '/')) ? ++ptr : argv[0]; | 334 return (ptr = strrchr (argv[0], '/')) ? ++ptr : argv[0]; |
331 | 335 |
332 return "xemacs"; | 336 return (Extbyte *) "xemacs"; /* shut up g++ 4.3 */ |
333 } | 337 } |
334 | 338 |
335 /* | 339 /* |
336 * This function figures out whether the user has any resources of the | 340 * This function figures out whether the user has any resources of the |
337 * form "XEmacs.foo" or "XEmacs*foo". | 341 * form "XEmacs.foo" or "XEmacs*foo". |
341 * xdefs = XScreenResourceString(ScreenOfDisplay(dpy, scrno)); | 345 * xdefs = XScreenResourceString(ScreenOfDisplay(dpy, scrno)); |
342 */ | 346 */ |
343 static int | 347 static int |
344 have_xemacs_resources_in_xrdb (Display *dpy) | 348 have_xemacs_resources_in_xrdb (Display *dpy) |
345 { | 349 { |
346 char *xdefs, *key; | 350 const char *xdefs, *key; |
347 int len; | 351 int len; |
348 | 352 |
349 #ifdef INFODOCK | 353 #ifdef INFODOCK |
350 key = "InfoDock"; | 354 key = "InfoDock"; |
351 #else | 355 #else |
686 data-directory/app-defaults/$LANG/Emacs. | 690 data-directory/app-defaults/$LANG/Emacs. |
687 This is in addition to the standard app-defaults files, and | 691 This is in addition to the standard app-defaults files, and |
688 does not override resources defined elsewhere */ | 692 does not override resources defined elsewhere */ |
689 const Extbyte *data_dir; | 693 const Extbyte *data_dir; |
690 Extbyte *path; | 694 Extbyte *path; |
691 Extbyte *format; | 695 const Extbyte *format; |
692 XrmDatabase db = XtDatabase (dpy); /* #### XtScreenDatabase(dpy) ? */ | 696 XrmDatabase db = XtDatabase (dpy); /* #### XtScreenDatabase(dpy) ? */ |
693 Extbyte *locale = xstrdup (XrmLocaleOfDatabase (db)); | 697 const Extbyte *locale = xstrdup (XrmLocaleOfDatabase (db)); |
694 Extbyte *locale_end; | 698 Extbyte *locale_end; |
695 | 699 |
696 if (STRINGP (Vx_app_defaults_directory) && | 700 if (STRINGP (Vx_app_defaults_directory) && |
697 XSTRING_LENGTH (Vx_app_defaults_directory) > 0) | 701 XSTRING_LENGTH (Vx_app_defaults_directory) > 0) |
698 { | 702 { |
737 if (!access (path, R_OK)) | 741 if (!access (path, R_OK)) |
738 XrmCombineFileDatabase (path, &db, False); | 742 XrmCombineFileDatabase (path, &db, False); |
739 } | 743 } |
740 | 744 |
741 no_data_directory: | 745 no_data_directory: |
742 xfree (locale, Extbyte*); | 746 { |
747 /* Cast off const for G++ 4.3. */ | |
748 Extbyte *temp = (Extbyte *) locale; | |
749 xfree (temp, Extbyte*); | |
750 } | |
743 } | 751 } |
744 #endif /* MULE */ | 752 #endif /* MULE */ |
745 | 753 |
746 if (NILP (DEVICE_NAME (d))) | 754 if (NILP (DEVICE_NAME (d))) |
747 DEVICE_NAME (d) = display; | 755 DEVICE_NAME (d) = display; |
859 | 867 |
860 /* #### If we're going to implement X session management, this would | 868 /* #### If we're going to implement X session management, this would |
861 be the place. Make sure it doesn't conflict with GNOME. */ | 869 be the place. Make sure it doesn't conflict with GNOME. */ |
862 { | 870 { |
863 Arg al[3]; | 871 Arg al[3]; |
864 XtSetArg (al[0], XtNvisual, visual); | 872 Xt_SET_ARG (al[0], XtNvisual, visual); |
865 XtSetArg (al[1], XtNdepth, depth); | 873 Xt_SET_ARG (al[1], XtNdepth, depth); |
866 XtSetArg (al[2], XtNcolormap, cmap); | 874 Xt_SET_ARG (al[2], XtNcolormap, cmap); |
867 | 875 |
868 app_shell = XtAppCreateShell (NULL, app_class, | 876 app_shell = XtAppCreateShell (NULL, app_class, |
869 applicationShellWidgetClass, | 877 applicationShellWidgetClass, |
870 dpy, al, countof (al)); | 878 dpy, al, countof (al)); |
871 } | 879 } |
878 | 886 |
879 /* Realize the app_shell so that its window exists for GC creation purposes, | 887 /* Realize the app_shell so that its window exists for GC creation purposes, |
880 and set it to the size of the root window for child placement purposes */ | 888 and set it to the size of the root window for child placement purposes */ |
881 { | 889 { |
882 Arg al[5]; | 890 Arg al[5]; |
883 XtSetArg (al[0], XtNmappedWhenManaged, False); | 891 Xt_SET_ARG (al[0], XtNmappedWhenManaged, False); |
884 XtSetArg (al[1], XtNx, 0); | 892 Xt_SET_ARG (al[1], XtNx, 0); |
885 XtSetArg (al[2], XtNy, 0); | 893 Xt_SET_ARG (al[2], XtNy, 0); |
886 XtSetArg (al[3], XtNwidth, WidthOfScreen (ScreenOfDisplay (dpy, screen))); | 894 Xt_SET_ARG (al[3], XtNwidth, |
887 XtSetArg (al[4], XtNheight, HeightOfScreen (ScreenOfDisplay (dpy, screen))); | 895 WidthOfScreen (ScreenOfDisplay (dpy, screen))); |
896 Xt_SET_ARG (al[4], XtNheight, | |
897 HeightOfScreen (ScreenOfDisplay (dpy, screen))); | |
888 XtSetValues (app_shell, al, countof (al)); | 898 XtSetValues (app_shell, al, countof (al)); |
889 XtRealizeWidget (app_shell); | 899 XtRealizeWidget (app_shell); |
890 } | 900 } |
891 | 901 |
892 #ifdef HAVE_WMCOMMAND | 902 #ifdef HAVE_WMCOMMAND |