[PATCH] configure,configure.ac: Fixed two typos in args of main: char *v -> char **v
15 years, 12 months
Vladimir G. Ivanovic
Is this correct format (generated with 'hg diff')?
--- Vladimir
--
Vladimir G. Ivanovic
diff -r 83e35df20028 ChangeLog
--- a/ChangeLog Mon Sep 08 08:48:22 2008 +0200
+++ b/ChangeLog Thu Sep 18 10:14:31 2008 -0700
@@ -1,3 +1,8 @@
+2008-09-17 Vladimir G. Ivanovic <vladimir(a)acm.org>
+
+ * configure: Fixed two typos in args of main: char *v -> char **v
+ * configure.ac: Fixed two typos in args of main: char *v -> char **v
+
2008-08-03 Mats Lidell <matsl(a)xemacs.org>
* configure.ac: Fix typo xft_gauge to xft_gauges
diff -r 83e35df20028 configure
--- a/configure Mon Sep 08 08:48:22 2008 +0200
+++ b/configure Thu Sep 18 10:14:31 2008 -0700
@@ -19012,7 +19012,7 @@
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
#include <X11/Intrinsic.h>
- int main(int c, char *v) { return c>1 ? XlibSpecificationRelease : 0; }
+ int main(int c, char **v) { return c>1 ? XlibSpecificationRelease : 0; }
_ACEOF
rm -f conftest$ac_exeext
if { (ac_try="$ac_link"
@@ -38857,7 +38857,7 @@
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
-int main(int c,char *v){return 0;}
+int main(int c,char **v){return 0;}
_ACEOF
rm -f conftest$ac_exeext
if { (ac_try="$ac_link"
diff -r 83e35df20028 configure.ac
--- a/configure.ac Mon Sep 08 08:48:22 2008 +0200
+++ b/configure.ac Thu Sep 18 10:14:32 2008 -0700
@@ -3427,7 +3427,7 @@
AC_MSG_CHECKING(the version of X11 being used)
AC_RUN_IFELSE([AC_LANG_SOURCE([#include <X11/Intrinsic.h>
- int main(int c, char *v[]) { return c>1 ? XlibSpecificationRelease : 0; }])],
+ int main(int c, char **v[]) { return c>1 ? XlibSpecificationRelease : 0; }])],
[./conftest foobar; x11_release=$?],[x11_release=4],[x11_release=4])
AC_MSG_RESULT(R${x11_release})
AC_DEFINE_UNQUOTED(THIS_IS_X11R${x11_release})
@@ -5575,7 +5575,7 @@
dnl One of the above link tests may have succeeded but caused resulting
dnl executables to fail to run. Also any tests using AC_RUN_IFELSE will
dnl have reported incorrect results.
-AC_RUN_IFELSE([AC_LANG_SOURCE([int main(int c,char *v[]){return 0;}])],[:],[
+AC_RUN_IFELSE([AC_LANG_SOURCE([int main(int c,char **v[]){return 0;}])],[:],[
echo ""
echo "*** PANIC *** The C compiler can no longer build working executables."
echo "*** PANIC *** Please examine the tail of config.log for runtime errors."
_______________________________________________
XEmacs-Patches mailing list
XEmacs-Patches(a)xemacs.org
http://calypso.tux.org/cgi-bin/mailman/listinfo/xemacs-patches
[COMMIT] Correct the initialisation of rot13-display-table
16 years
Aidan Kehoe
APPROVE COMMIT
Oops, this was an embarrassingly simple bug.
NOTE: This patch has been committed.
xemacs-packages/misc-games/ChangeLog addition:
2008-11-29 Aidan Kehoe <kehoea(a)parhasard.net>
* rot13.el (rot13-display-table):
Correct the placement of a parenthesis, and with it, the
initialisation of the variable.
XEmacs Packages source patch:
Diff command: cvs -q diff -Nu
Files affected: xemacs-packages/misc-games/rot13.el
===================================================================
RCS
Index: xemacs-packages/misc-games/rot13.el
===================================================================
RCS file: /pack/xemacscvs/XEmacs/packages/xemacs-packages/misc-games/rot13.el,v
retrieving revision 1.3
diff -u -u -r1.3 rot13.el
--- xemacs-packages/misc-games/rot13.el 2007/12/24 19:18:14 1.3
+++ xemacs-packages/misc-games/rot13.el 2008/11/29 17:39:58
@@ -50,8 +50,8 @@
(table (make-display-table)))
(while (< (incf i) 26)
(put-display-table (+ i a) (char-to-string (int-to-char (+ (% (+ i 13) 26) a))) table)
- (put-display-table (+ i A) (char-to-string (int-to-char (+ (% (+ i 13) 26) A))) table)
- table))
+ (put-display-table (+ i A) (char-to-string (int-to-char (+ (% (+ i 13) 26) A))) table))
+ table)
"Char table for rot 13 display.")
;;;###autoload
--
¿Dónde estará ahora mi sobrino Yoghurtu Nghé, que tuvo que huir
precipitadamente de la aldea por culpa de la escasez de rinocerontes?
_______________________________________________
XEmacs-Patches mailing list
XEmacs-Patches(a)xemacs.org
http://calypso.tux.org/cgi-bin/mailman/listinfo/xemacs-patches
[PACKAGES (slider)] Add compatibility code for SXEmacs' non-broken extents
16 years, 1 month
Steve Youngs
Some years ago (2005) there was a discussion on the XEmacs and SXEmacs
lists about extent glyphs for zero-length extents, and how they should
be ordered when you have multiple "adjacent" zero-length extents.
For some background, see...
http://www.sxemacs.org/list-archives/html/sxemacs-devel/2005-06/msg00000....
http://www.sxemacs.org/list-archives/html/sxemacs-devel/2005-06/msg00008....
http://www.sxemacs.org/list-archives/html/sxemacs-devel/2005-06/msg00029....
I didn't have much success in finding the relevant threads on the XEmacs
lists. So I'm not sure what became of the issue in XEmacs land. My gut
tells me that it simply got forgotten about.
Now, because of this "flaw" in XEmacs extents, and because it has been
this way for eons, it's really not surprising that there is code out
there that breaks when given fixed extents to work with. :-)
http://www.sxemacs.org/~steve/bugs/bug-94_movie_1.avi is a short AVI
which graphically demonstrates the problem that this patch addresses.
In the video, XEmacs 21.5 is on the left, and SXEmacs is on the right.
Norbert, I don't have commit access to XEmacs CVS anymore (think my key
is fubar'd), so can you please commit this for me. Thanks!
slider patch:
ChangeLog files diff command: cvs -q diff -U 0
Files affected: ChangeLog
Source files diff command: cvs -q diff -uN
Files affected: slider.el
Index: ChangeLog
===================================================================
RCS file: /pack/xemacscvs/XEmacs/packages/xemacs-packages/slider/ChangeLog,v
retrieving revision 1.12
diff -u -p -U0 -r1.12 ChangeLog
--- ChangeLog 2003/10/31 17:08:09 1.12
+++ ChangeLog 2008/11/13 08:40:57
@@ -0,0 +1,7 @@
+2008-11-13 Steve Youngs <steve(a)sxemacs.org>
+
+ * slider.el: Add compatibility code for SXEmacs.
+ (slider-new): Use it.
+ (slider-set): Use it.
+ (slider-activate-arrow-or-bar): Use it.
+
Index: slider.el
===================================================================
RCS file: /pack/xemacscvs/XEmacs/packages/xemacs-packages/slider/slider.el,v
retrieving revision 1.2
diff -u -p -u -r1.2 slider.el
--- slider.el 2000/10/06 08:44:47 1.2
+++ slider.el 2008/11/13 08:40:54
@@ -23,8 +23,24 @@
;; Code:
;;
-;;; First of all we'll define the needed variables.
+;;; Compatibility.
+
+;; There is a bug in XEmacs extents where the order of extent glyphs
+;; can get messed up when you have zero-length extents. SXEmacs has
+;; this fixed, but because it is such a long-standing bug code like
+;; this was written against the "buggy" extent api and so "breaks"
+;; when used with non-buggy extents. Hence this compatibility snippet
+;; here. --SY.
+(eval-and-compile
+ (if (featurep 'sxemacs)
+ (progn
+ (fset #'slider-set-glyph #'set-extent-end-glyph)
+ (fset #'slider-glyph #'extent-end-glyph))
+ (fset #'slider-set-glyph #'set-extent-begin-glyph)
+ (fset #'slider-glyph #'extent-begin-glyph)))
+
+;;; First of all we'll define the needed variables.
(defconst slider-bar-elem-width 4)
@@ -64,7 +80,7 @@
(insert-string " ")
(goto-char (1- (point)))
- (setq slider (make-extent (1- (point)) (1+ (point))))
+ (setq slider (make-extent (point) (point)))
(set-extent-property slider 'keymap slider-bar-keymap)
(set-extent-property slider 'read-only read-only)
(set-extent-property slider 'start-open t)
@@ -113,16 +129,16 @@
(set-extent-property tmp 'slider-down slider-right-down)
;; initializing the display:
;; left arrow glyph:
- (set-extent-begin-glyph (aref left-vector 0) slider-left-up)
+ (slider-set-glyph (aref left-vector 0) slider-left-up)
;; the left bar is invisible, so make the knob glyph:
- (set-extent-begin-glyph knob slider-knob)
+ (slider-set-glyph knob slider-knob)
;; the right part of the bar is fully visible
(let ((count 0))
(while (< count number-of-bars)
- (set-extent-begin-glyph (aref right-vector count) slider-element)
+ (slider-set-glyph (aref right-vector count) slider-element)
(setq count (1+ count))))
;; the right arrow glyph
- (set-extent-begin-glyph (aref right-vector number-of-bars) slider-right-up)
+ (slider-set-glyph (aref right-vector number-of-bars) slider-right-up)
;; put some needed information into the knob's properties.
(set-extent-property knob 'slider-action 'slider-drag-knob)
(set-extent-keymap knob slider-knob-keymap)
@@ -154,26 +170,26 @@
abs-value min max)
(let ((count 1))
(while (<= count step)
- (set-extent-begin-glyph
+ (slider-set-glyph
(aref (extent-property slider 'slider-left)
count)
slider-element)
(setq count (1+ count)))
(while (<= count length)
- (set-extent-begin-glyph
+ (slider-set-glyph
(aref (extent-property slider 'slider-left)
count)
nil)
(setq count (1+ count))))
(let ((count 0))
(while (< count step)
- (set-extent-begin-glyph
+ (slider-set-glyph
(aref (extent-property slider 'slider-right)
count)
nil)
(setq count (1+ count)))
(while (< count length)
- (set-extent-begin-glyph
+ (slider-set-glyph
(aref (extent-property slider 'slider-right)
count)
slider-element)
@@ -253,8 +269,8 @@
up-glyph down-glyph)
;; make the glyph look pressed
(cond ((setq down-glyph (extent-property extent 'slider-down))
- (setq up-glyph (extent-begin-glyph extent))
- (set-extent-begin-glyph extent down-glyph)))
+ (setq up-glyph (slider-glyph extent))
+ (slider-set-glyph extent down-glyph)))
(while mouse-down
(if (input-pending-p)
(setq event (next-event event))
@@ -263,7 +279,7 @@
(if (button-release-event-p event)
(setq mouse-down nil)))
;; make the glyph look released
- (if down-glyph (set-extent-begin-glyph extent up-glyph))))
+ (if down-glyph (slider-set-glyph extent up-glyph))))
(defun slider-activate-knob (event)
(interactive "e")
--
|---<Steve Youngs>---------------<GnuPG KeyID: A94B3003>---|
| SXEmacs - The only _______ you'll ever need. |
| Fill in the blank, yes, it's THAT good! |
|------------------------------------<steve(a)sxemacs.org>---|
_______________________________________________
XEmacs-Patches mailing list
XEmacs-Patches(a)xemacs.org
http://calypso.tux.org/cgi-bin/mailman/listinfo/xemacs-patches
carbon2-commit: ChangeLogs for G++ warning cleanup.
16 years, 1 month
Aidan Kehoe
changeset: 4566:b58af9a9765dec7ac331ed18350012172389688d
user: Stephen J. Turnbull <stephen(a)xemacs.org>
date: Sun Nov 02 03:59:54 2008 +0900
files: lwlib/ChangeLog src/ChangeLog
description:
ChangeLogs for G++ warning cleanup.
diff -r 9b182263dbd7d51b7b1e5e4bfd903cfeafd4e29b -r b58af9a9765dec7ac331ed18350012172389688d lwlib/ChangeLog
--- a/lwlib/ChangeLog Sun Nov 02 03:11:29 2008 +0900
+++ b/lwlib/ChangeLog Sun Nov 02 03:59:54 2008 +0900
@@ -1,3 +1,92 @@ 2008-10-26 Stephen J. Turnbull <stephe
+2008-11-02 Stephen J. Turnbull <stephen(a)xemacs.org>
+
+ G++ 4.3 complains a lot about implicit conversions of string
+ literals (const char *) to char *. Shut it up.
+
+ * xt-wrappers.h: New file.
+ Contains wrappers for Xt functions and macros for C++
+ type-correctness and/or convenience.
+
+ * lwlib.h:
+ * lwlib-Xm.c:
+ * lwlib-Xaw.c:
+ #include xt-wrappers.h.
+
+ * xlwcheckbox.c:
+ * xlwgauge.c:
+ * xlwmenu.c:
+ * xlwradio.c:
+ * xlwscrollbar.c:
+ * xlwtabs.c:
+ #include xt-wrappers.h.
+ Cast class name to String.
+ Cast action names to String.
+ Rewrite resources to use Xt_RESOURCE.
+
+ * lwlib.h (lw_get_value_arg):
+ * lwlib.c (lw_get_value_arg):
+ Declare String argument const.
+
+ * lwlib-Xaw.c (xaw_actions):
+ Cast to string.
+
+ * lwlib-Xaw.c (xaw_update_scrollbar):
+ * lwlib-Xaw.c (xaw_update_one_widget):
+ * lwlib-Xaw.c (xaw_update_one_value):
+ * lwlib-Xaw.c (make_dialog):
+ * lwlib-Xaw.c (xaw_generic_callback):
+ * lwlib-Xaw.c (wm_delete_window):
+ * lwlib-Xaw.c (xaw_create_scrollbar):
+ * lwlib-Xaw.c (xaw_create_button):
+ * lwlib-Xaw.c (xaw_create_label):
+ * lwlib-Xaw.c (xaw_create_progress):
+ * lwlib-Xaw.c (xaw_create_text_field):
+ * lwlib-Xaw.c (xaw_creation_table):
+ * lwlib-Xlw.c (xlw_create_menubar):
+ * lwlib-Xlw.c (xlw_create_popup_menu):
+ * lwlib-Xlw.c (xlw_create_scrollbar):
+ * lwlib-Xlw.c (xlw_update_scrollbar):
+ * lwlib-Xlw.c (xlw_create_tab_control):
+ * lwlib-Xlw.c (build_tabs_in_widget):
+ * lwlib-Xlw.c (xlw_create_clip_window):
+ * lwlib-Xlw.c (xlw_update_one_widget):
+ * lwlib-Xm.c (xm_update_label):
+ * lwlib-Xm.c (xm_update_pushbutton):
+ * lwlib-Xm.c (xm_update_progress):
+ * lwlib-Xm.c (xm_update_toggle):
+ * lwlib-Xm.c (xm_update_radiobox):
+ * lwlib-Xm.c (make_menu_in_widget):
+ * lwlib-Xm.c (update_one_menu_entry):
+ * lwlib-Xm.c (xm_update_scrollbar):
+ * lwlib-Xm.c (xm_update_one_value):
+ * lwlib-Xm.c (make_dialog):
+ * lwlib-Xm.c (recenter_widget):
+ * lwlib-Xm.c (recycle_instance):
+ * lwlib-Xm.c (make_menubar):
+ * lwlib-Xm.c (make_scrollbar):
+ * lwlib-Xm.c (xm_create_button):
+ * lwlib-Xm.c (xm_create_progress):
+ * lwlib-Xm.c (xm_create_text_field):
+ * lwlib-Xm.c (xm_create_label):
+ * lwlib-Xm.c (xm_create_combo_box):
+ * lwlib-Xm.c (xm_popup_menu):
+ * lwlib-Xm.c (set_min_dialog_size):
+ * lwlib-Xm.c (do_call):
+ * lwlib-Xm.c (xm_generic_callback):
+ * xlwcheckbox.c (offset):
+ * xlwgauge.c (offset):
+ * xlwgauge.c (actionsList):
+ * xlwmenu.c (xlwMenuResources):
+ * xlwmenu.c (xlwMenuActionsList):
+ * xlwmenu.c (xlwMenuClassRec):
+ * xlwmenu.c (nameResource):
+ * xlwmenu.c (parameterize_string):
+ * xlwradio.c (actionsList):
+ * xlwscrollbar.c (offset):
+ * xlwscrollbar.c (actions):
+ Use Xt_SET_ARG, Xt_SET_VALUE, and Xt_GET_VALUE instead of raw Xt
+ equivalents.
+
2008-10-26 Stephen J. Turnbull <stephen(a)xemacs.org>
* lwlib-Xm.c (xm_update_progress): Set all values!
diff -r 9b182263dbd7d51b7b1e5e4bfd903cfeafd4e29b -r b58af9a9765dec7ac331ed18350012172389688d src/ChangeLog
--- a/src/ChangeLog Sun Nov 02 03:11:29 2008 +0900
+++ b/src/ChangeLog Sun Nov 02 03:59:54 2008 +0900
@@ -1,3 +1,73 @@ 2008-11-01 Stephen J. Turnbull <stephe
+2008-11-02 Stephen J. Turnbull <stephen(a)xemacs.org>
+
+ G++ 4.3 complains a lot about implicit conversions of string
+ literals (const char *) to char *. Shut it up.
+
+ * console-x.h:
+ * EmacsFrame.c:
+ * EmacsManager.c:
+ * EmacsShell-sub.c:
+ #include ../lwlib/xt-wrappers.h.
+ Cast class name to String.
+ Cast action names to String.
+ Rewrite resources to use Xt_RESOURCE.
+
+ * console-x.h:
+ Move Xt_SET_VALUE and Xt_GET_VALUE to ../lwlib/xt-wrappers.h.
+
+ * console-x.h (describe_XRectangle):
+ * input-method-xlib.c (describe_XRectangle):
+ * emacs.c (argmatch):
+ * emacs.c (check_compatible_window_system):
+ * emodules.c (Fload_module):
+ * emodules.c (Funload_module):
+ * event-stream.c (external_debugging_print_event):
+ * file-coding.h (struct subsidiary_type):
+ * file-coding.c (struct subsidiary_type):
+ * file-coding.c (setup_eol_coding_systems):
+ * file-coding.c (make_coding_system_1):
+ * file-coding.c (make_internal_coding_system):
+ * gif_io.c (GifErrorString:
+ * gif_io.c (GetGifError):
+ * input-method-xlib.c (XIM_init_frame):
+ * mule-coding.c (ccl_putprop):
+ * print.c (printing_major_badness):
+ * redisplay.c (generate_fstring_runes):
+ Declare String or char * argument or variable as const.
+
+ * EmacsFrame.c (EmacsFrameSetCharSize):
+ * EmacsShell-sub.c (update_size_hints_internal):
+ * EmacsShell-sub.c (SuperClassRootGeometryManager):
+ * device-x.c (emacs_options):
+ * device-x.c (compute_x_app_name):
+ * device-x.c (have_xemacs_resources_in_xrdb):
+ * device-x.c (x_init_device):
+ * event-Xt.c (x_fallback_resources):
+ * event-Xt.c (widgetActionsList):
+ * event-Xt.c (emacs_Xt_event_add_widget_actions):
+ * frame-x.c (x_wm_set_cell_size):
+ * frame-x.c (x_wm_set_variable_size):
+ * frame-x.c (x_set_frame_text_value):
+ * frame-x.c (x_initialize_frame_size):
+ * frame-x.c (x_create_widgets):
+ * frame-x.c (x_set_frame_icon):
+ * frame-x.c (x_set_frame_position):
+ * frame-x.c (x_update_frame_external_traits):
+ * glyphs-x.c (x_redisplay_widget):
+ * glyphs-x.c (update_tab_widget_face):
+ * glyphs-x.c (x_widget_instantiate):
+ * glyphs-x.c (x_button_instantiate):
+ * glyphs-x.c (x_progress_gauge_redisplay):
+ * glyphs-x.c (x_tab_control_redisplay):
+ * menubar-x.c (make_dummy_xbutton_event):
+ Use Xt_SET_ARG, Xt_SET_VALUE, and Xt_GET_VALUE instead of raw Xt
+ equivalents.
+ Declare String or char * argument or local variable as const.
+ Cast string literals to char* (or equivalent).
+
+ * input-method-xlib.c:
+ Use Xt_RESOURCE.
+
2008-11-01 Stephen J. Turnbull <stephen(a)xemacs.org>
* regex.c (re_search_2): Fix at_dot by changing charpos to bytepos.
_______________________________________________
XEmacs-Patches mailing list
XEmacs-Patches(a)xemacs.org
http://calypso.tux.org/cgi-bin/mailman/listinfo/xemacs-patches
carbon2-commit: Merge bytecomp-coding-system-2008-10-29.
16 years, 1 month
Aidan Kehoe
changeset: 4565:9b182263dbd7d51b7b1e5e4bfd903cfeafd4e29b
parent: 4564:6f41fb7f3a6570572f5c03b39d8e9a436dae1ec3
parent: 4562:8418d1ad49444db104dd28923211ed61c77115ba
user: Stephen J. Turnbull <stephen(a)xemacs.org>
date: Sun Nov 02 03:11:29 2008 +0900
files:
description:
Merge bytecomp-coding-system-2008-10-29.
diff -r 6f41fb7f3a6570572f5c03b39d8e9a436dae1ec3 -r 9b182263dbd7d51b7b1e5e4bfd903cfeafd4e29b src/ChangeLog
--- a/src/ChangeLog Wed Oct 29 12:59:48 2008 +0900
+++ b/src/ChangeLog Sun Nov 02 03:11:29 2008 +0900
@@ -1,3 +1,13 @@ 2008-10-25 Stephen J. Turnbull <stephe
+2008-11-01 Stephen J. Turnbull <stephen(a)xemacs.org>
+
+ * regex.c (re_search_2): Fix at_dot by changing charpos to bytepos.
+ From Julian Bradfield <18654.1143.304851.782755(a)krk.inf.ed.ac.uk>.
+
+2008-11-01 Stephen J. Turnbull <stephen(a)xemacs.org>
+
+ * mule-ccl.c (ccl_driver): Fix off-by-one error.
+ By Julian Bradfield in <18691.16568.526264.972026(a)krk.inf.ed.ac.uk>.
+
2008-10-25 Stephen J. Turnbull <stephen(a)xemacs.org>
* lisp.h (static_pro): Cast out a warning.
diff -r 6f41fb7f3a6570572f5c03b39d8e9a436dae1ec3 -r 9b182263dbd7d51b7b1e5e4bfd903cfeafd4e29b src/mule-ccl.c
--- a/src/mule-ccl.c Wed Oct 29 12:59:48 2008 +0900
+++ b/src/mule-ccl.c Sun Nov 02 03:11:29 2008 +0900
@@ -1455,7 +1455,7 @@ ccl_driver (struct ccl_program *ccl,
if (XCHARSET_DIMENSION (charset_by_leading_byte (i)) == 1)
i = (((i - FIELD2_TO_OFFICIAL_LEADING_BYTE) << 7)
| (reg[rrr] & 0x7F));
- else if (i < MAX_LEADING_BYTE_OFFICIAL_2)
+ else if (i <= MAX_LEADING_BYTE_OFFICIAL_2)
i = ((i - FIELD1_TO_OFFICIAL_LEADING_BYTE) << 14)
| reg[rrr];
else
diff -r 6f41fb7f3a6570572f5c03b39d8e9a436dae1ec3 -r 9b182263dbd7d51b7b1e5e4bfd903cfeafd4e29b src/regex.c
--- a/src/regex.c Wed Oct 29 12:59:48 2008 +0900
+++ b/src/regex.c Sun Nov 02 03:11:29 2008 +0900
@@ -4313,8 +4313,8 @@ re_search_2 (struct re_pattern_buffer *b
{
if (!BUFFERP (lispobj))
return -1;
- range = (BUF_PT (XBUFFER (lispobj)) - BUF_BEGV (XBUFFER (lispobj))
- - startpos);
+ range = (BYTE_BUF_PT (XBUFFER (lispobj))
+ - BYTE_BUF_BEGV (XBUFFER (lispobj)) - startpos);
if (range < 0)
return -1;
}
_______________________________________________
XEmacs-Patches mailing list
XEmacs-Patches(a)xemacs.org
http://calypso.tux.org/cgi-bin/mailman/listinfo/xemacs-patches
carbon2-commit: Protect .elc encoding from latin-unity.
16 years, 1 month
Aidan Kehoe
changeset: 4564:6f41fb7f3a6570572f5c03b39d8e9a436dae1ec3
user: Stephen J. Turnbull <stephen(a)xemacs.org>
date: Wed Oct 29 12:59:48 2008 +0900
files: lisp/ChangeLog lisp/bytecomp.el
description:
Protect .elc encoding from latin-unity.
diff -r 726060ee587c536ac95384a055029092ea091231 -r 6f41fb7f3a6570572f5c03b39d8e9a436dae1ec3 lisp/ChangeLog
--- a/lisp/ChangeLog Wed Oct 29 04:06:33 2008 +0900
+++ b/lisp/ChangeLog Wed Oct 29 12:59:48 2008 +0900
@@ -1,3 +1,7 @@ 2008-10-28 Stephen J. Turnbull <stephe
+2008-10-29 Stephen J. Turnbull <stephen(a)xemacs.org>
+
+ * bytecomp.el (byte-compile-file): Protect encoding from latin-unity.
+
2008-10-28 Stephen J. Turnbull <stephen(a)xemacs.org>
* version.el (xemacs-betaname): Fix docstring typo. (Thanks, Ville!)
diff -r 726060ee587c536ac95384a055029092ea091231 -r 6f41fb7f3a6570572f5c03b39d8e9a436dae1ec3 lisp/bytecomp.el
--- a/lisp/bytecomp.el Wed Oct 29 04:06:33 2008 +0900
+++ b/lisp/bytecomp.el Wed Oct 29 12:59:48 2008 +0900
@@ -1618,7 +1618,10 @@ With prefix arg (noninteractively: 2nd a
(unless byte-compile-overwrite-file
(ignore-file-errors (delete-file target-file)))
(if (file-writable-p target-file)
- (write-region 1 (point-max) target-file)
+ ;; prevent generic hooks from changing our format, eg,
+ ;; latin-unity is known to change the coding system!
+ (let ((write-region-pre-hook nil))
+ (write-region 1 (point-max) target-file))
;; This is just to give a better error message than write-region
(signal 'file-error
(list "Opening output file"
_______________________________________________
XEmacs-Patches mailing list
XEmacs-Patches(a)xemacs.org
http://calypso.tux.org/cgi-bin/mailman/listinfo/xemacs-patches
carbon2-commit: First draft of g++ 4.3 warning removal patch. Builds. *Needs ChangeLogs.*
16 years, 1 month
Aidan Kehoe
changeset: 4563:726060ee587c536ac95384a055029092ea091231
parent: 4559:03ba50f7ecd7fb0dee997f30f1f1b7af746c7493
user: Stephen J. Turnbull <stephen(a)xemacs.org>
date: Wed Oct 29 04:06:33 2008 +0900
files: lwlib/lwlib-Xaw.c lwlib/lwlib-Xlw.c lwlib/lwlib-Xm.c lwlib/lwlib.c lwlib/lwlib.h lwlib/xlwcheckbox.c lwlib/xlwgauge.c lwlib/xlwmenu.c lwlib/xlwradio.c lwlib/xlwscrollbar.c lwlib/xlwtabs.c lwlib/xt-wrappers.h src/EmacsFrame.c src/EmacsManager.c src/EmacsShell-sub.c src/console-x.h src/device-x.c src/emacs.c src/emodules.c src/event-Xt.c src/event-stream.c src/file-coding.c src/file-coding.h src/frame-x.c src/gif_io.c src/glyphs-x.c src/input-method-xlib.c src/menubar-x.c src/mule-coding.c src/print.c src/redisplay.c
description:
First draft of g++ 4.3 warning removal patch. Builds. *Needs ChangeLogs.*
diff -r 03ba50f7ecd7fb0dee997f30f1f1b7af746c7493 -r 726060ee587c536ac95384a055029092ea091231 lwlib/lwlib-Xaw.c
--- a/lwlib/lwlib-Xaw.c Wed Oct 29 04:02:05 2008 +0900
+++ b/lwlib/lwlib-Xaw.c Wed Oct 29 04:06:33 2008 +0900
@@ -88,15 +88,15 @@ xaw_update_scrollbar (widget_instance *i
Arg al [10];
/* First size and position the scrollbar widget. */
- XtSetArg (al [0], XtNx, data->scrollbar_x);
- XtSetArg (al [1], XtNy, data->scrollbar_y);
- XtSetArg (al [2], XtNwidth, data->scrollbar_width);
- XtSetArg (al [3], XtNheight, data->scrollbar_height);
+ Xt_SET_ARG (al [0], XtNx, data->scrollbar_x);
+ Xt_SET_ARG (al [1], XtNy, data->scrollbar_y);
+ Xt_SET_ARG (al [2], XtNwidth, data->scrollbar_width);
+ Xt_SET_ARG (al [3], XtNheight, data->scrollbar_height);
XtSetValues (widget, al, 4);
/* Now size the scrollbar's slider. */
- XtSetArg (al [0], XtNtopOfThumb, &widget_topOfThumb);
- XtSetArg (al [1], XtNshown, &widget_shown);
+ Xt_SET_ARG (al [0], XtNtopOfThumb, &widget_topOfThumb);
+ Xt_SET_ARG (al [1], XtNshown, &widget_shown);
XtGetValues (widget, al, 2);
new_shown = (double) data->slider_size /
@@ -142,47 +142,37 @@ xaw_update_one_widget (widget_instance *
#endif
#ifdef LWLIB_DIALOGS_ATHENA
else if (XtIsSubclass (widget, dialogWidgetClass))
- {
- Arg al [1];
- XtSetArg (al [0], XtNlabel, val->contents->value);
- XtSetValues (widget, al, 1);
- }
+ Xt_SET_VALUE (widget, XtNlabel, val->contents->value);
#endif /* LWLIB_DIALOGS_ATHENA */
#ifdef LWLIB_WIDGETS_ATHENA
else if (XtClass (widget) == labelWidgetClass)
- {
- Arg al [1];
- XtSetArg (al [0], XtNlabel, val->value);
- XtSetValues (widget, al, 1);
- }
+ Xt_SET_VALUE (widget, XtNlabel, val->value);
#endif /* LWLIB_WIDGETS_ATHENA */
#if defined (LWLIB_DIALOGS_ATHENA) || defined (LWLIB_WIDGETS_ATHENA)
else if (XtIsSubclass (widget, commandWidgetClass))
{
- Dimension bw = 0;
Arg al [3];
- XtSetArg (al [0], XtNborderWidth, &bw);
- XtGetValues (widget, al, 1);
#ifndef LWLIB_DIALOGS_ATHENA3D
- if (bw == 0)
- /* Don't let buttons end up with 0 borderwidth, that's ugly...
- Yeah, all this should really be done through app-defaults files
- or fallback resources, but that's a whole different can of worms
- that I don't feel like opening right now. Making Athena widgets
- not look like shit is just entirely too much work.
- */
- {
- XtSetArg (al [0], XtNborderWidth, 1);
- XtSetValues (widget, al, 1);
+ {
+ Dimension bw = 0;
+ Xt_GET_VALUE (widget, XtNborderWidth, &bw);
+ if (bw == 0)
+ /* Don't let buttons end up with 0 borderwidth, that's ugly...
+ Yeah, all this should really be done through app-defaults files
+ or fallback resources, but that's a whole different can of worms
+ that I don't feel like opening right now. Making Athena widgets
+ not look like shit is just entirely too much work.
+ */
+ Xt_SET_VALUE (widget, XtNborderWidth, 1);
}
#endif /* ! LWLIB_DIALOGS_ATHENA3D */
lw_remove_accelerator_spec (val->value);
- XtSetArg (al [0], XtNlabel, val->value);
- XtSetArg (al [1], XtNsensitive, val->enabled);
+ Xt_SET_ARG (al [0], XtNlabel, val->value);
+ Xt_SET_ARG (al [1], XtNsensitive, val->enabled);
/* Force centered button text. See above. */
- XtSetArg (al [2], XtNjustify, XtJustifyCenter);
+ Xt_SET_ARG (al [2], XtNjustify, XtJustifyCenter);
XtSetValues (widget, al, 3);
XtRemoveAllCallbacks (widget, XtNcallback);
@@ -190,10 +180,7 @@ xaw_update_one_widget (widget_instance *
#ifdef LWLIB_WIDGETS_ATHENA
/* set the selected state */
if (XtIsSubclass (widget, toggleWidgetClass))
- {
- XtSetArg (al [0], XtNstate, val->selected);
- XtSetValues (widget, al, 1);
- }
+ Xt_SET_VALUE (widget, XtNstate, val->selected);
#endif /* LWLIB_WIDGETS_ATHENA */
}
#endif /* LWLIB_DIALOGS_ATHENA */
@@ -219,19 +206,15 @@ xaw_update_one_value (widget_instance *i
if (XtIsSubclass (widget, toggleWidgetClass))
{
- Arg al [1];
- XtSetArg (al [0], XtNstate, &val->selected);
- XtGetValues (widget, al, 1);
+ Xt_GET_VALUE (widget, XtNstate, &val->selected);
val->edited = True;
}
#ifndef NEED_MOTIF
else if (XtIsSubclass (widget, asciiTextWidgetClass))
{
- Arg al [2];
String buf = 0;
- XtSetArg (al [0], XtNstring, &buf);
- XtGetValues (widget, al, 1);
-
+
+ Xt_GET_VALUE (widget, XtNstring, &buf);
if (val->value)
{
free (val->value);
@@ -339,7 +322,7 @@ static XtActionProc wm_delete_window (Wi
static XtActionProc wm_delete_window (Widget shell, XtPointer closure,
XtPointer call_data);
static XtActionsRec xaw_actions [] = {
- {"lwlib_delete_dialog", (XtActionProc) wm_delete_window}
+ { (String) "lwlib_delete_dialog", (XtActionProc) wm_delete_window}
};
static Boolean actions_initted = False;
@@ -375,9 +358,9 @@ make_dialog (const char* name, Widget pa
override = XtParseTranslationTable (overrideTrans);
ac = 0;
- XtSetArg (av[ac], XtNtitle, shell_title); ac++;
- XtSetArg (av[ac], XtNallowShellResize, True); ac++;
- XtSetArg (av[ac], XtNtransientFor, parent); ac++;
+ Xt_SET_ARG (av[ac], XtNtitle, shell_title); ac++;
+ Xt_SET_ARG (av[ac], XtNallowShellResize, True); ac++;
+ Xt_SET_ARG (av[ac], XtNtransientFor, parent); ac++;
shell = XtCreatePopupShell ("dialog", transientShellWidgetClass,
parent, av, ac);
XtOverrideTranslations (shell, override);
@@ -390,12 +373,12 @@ make_dialog (const char* name, Widget pa
for (i = 0; i < left_buttons; i++)
{
ac = 0;
- XtSetArg (av [ac], XtNfromHoriz, button); ac++;
- XtSetArg (av [ac], XtNleft, XtChainLeft); ac++;
- XtSetArg (av [ac], XtNright, XtChainLeft); ac++;
- XtSetArg (av [ac], XtNtop, XtChainBottom); ac++;
- XtSetArg (av [ac], XtNbottom, XtChainBottom); ac++;
- XtSetArg (av [ac], XtNresizable, True); ac++;
+ Xt_SET_ARG (av [ac], XtNfromHoriz, button); ac++;
+ Xt_SET_ARG (av [ac], XtNleft, XtChainLeft); ac++;
+ Xt_SET_ARG (av [ac], XtNright, XtChainLeft); ac++;
+ Xt_SET_ARG (av [ac], XtNtop, XtChainBottom); ac++;
+ Xt_SET_ARG (av [ac], XtNbottom, XtChainBottom); ac++;
+ Xt_SET_ARG (av [ac], XtNresizable, True); ac++;
sprintf (button_name, "button%d", ++bc);
button = XtCreateManagedWidget (button_name, commandWidgetClass,
dialog, av, ac);
@@ -410,18 +393,18 @@ make_dialog (const char* name, Widget pa
window) but I can't seem to make it do it.
*/
ac = 0;
- XtSetArg (av [ac], XtNfromHoriz, button); ac++;
-/* XtSetArg (av [ac], XtNfromVert, XtNameToWidget (dialog, "label")); ac++; */
- XtSetArg (av [ac], XtNleft, XtChainLeft); ac++;
- XtSetArg (av [ac], XtNright, XtChainRight); ac++;
- XtSetArg (av [ac], XtNtop, XtChainBottom); ac++;
- XtSetArg (av [ac], XtNbottom, XtChainBottom); ac++;
- XtSetArg (av [ac], XtNlabel, ""); ac++;
- XtSetArg (av [ac], XtNwidth, 30); ac++; /* #### aaack!! */
- XtSetArg (av [ac], XtNborderWidth, 0); ac++;
- XtSetArg (av [ac], XtNshapeStyle, XmuShapeRectangle); ac++;
- XtSetArg (av [ac], XtNresizable, False); ac++;
- XtSetArg (av [ac], XtNsensitive, False); ac++;
+ Xt_SET_ARG (av [ac], XtNfromHoriz, button); ac++;
+/* Xt_SET_ARG (av [ac], XtNfromVert, XtNameToWidget (dialog, "label")); ac++; */
+ Xt_SET_ARG (av [ac], XtNleft, XtChainLeft); ac++;
+ Xt_SET_ARG (av [ac], XtNright, XtChainRight); ac++;
+ Xt_SET_ARG (av [ac], XtNtop, XtChainBottom); ac++;
+ Xt_SET_ARG (av [ac], XtNbottom, XtChainBottom); ac++;
+ Xt_SET_ARG (av [ac], XtNlabel, ""); ac++;
+ Xt_SET_ARG (av [ac], XtNwidth, 30); /* #### aaack!! */ ac++;
+ Xt_SET_ARG (av [ac], XtNborderWidth, 0); ac++;
+ Xt_SET_ARG (av [ac], XtNshapeStyle, XmuShapeRectangle); ac++;
+ Xt_SET_ARG (av [ac], XtNresizable, False); ac++;
+ Xt_SET_ARG (av [ac], XtNsensitive, False); ac++;
button = XtCreateManagedWidget ("separator",
/* labelWidgetClass, */
/* This has to be Command to fake out
@@ -432,12 +415,12 @@ make_dialog (const char* name, Widget pa
for (i = 0; i < right_buttons; i++)
{
ac = 0;
- XtSetArg (av [ac], XtNfromHoriz, button); ac++;
- XtSetArg (av [ac], XtNleft, XtChainRight); ac++;
- XtSetArg (av [ac], XtNright, XtChainRight); ac++;
- XtSetArg (av [ac], XtNtop, XtChainBottom); ac++;
- XtSetArg (av [ac], XtNbottom, XtChainBottom); ac++;
- XtSetArg (av [ac], XtNresizable, True); ac++;
+ Xt_SET_ARG (av [ac], XtNfromHoriz, button); ac++;
+ Xt_SET_ARG (av [ac], XtNleft, XtChainRight); ac++;
+ Xt_SET_ARG (av [ac], XtNright, XtChainRight); ac++;
+ Xt_SET_ARG (av [ac], XtNtop, XtChainBottom); ac++;
+ Xt_SET_ARG (av [ac], XtNbottom, XtChainBottom); ac++;
+ Xt_SET_ARG (av [ac], XtNresizable, True); ac++;
sprintf (button_name, "button%d", ++bc);
button = XtCreateManagedWidget (button_name, commandWidgetClass,
dialog, av, ac);
@@ -525,13 +508,10 @@ xaw_generic_callback (Widget widget, XtP
if (XtIsSubclass (widget, toggleWidgetClass))
{
Boolean check;
- Arg al [1];
-
- XtSetArg (al [0], XtNstate, &check);
- XtGetValues (widget, al, 1);
-
- XtSetArg (al [0], XtNstate, !check);
- XtSetValues (widget, al, 1);
+
+ Xt_GET_VALUE (widget, XtNstate, &check);
+
+ Xt_SET_VALUE (widget, XtNstate, !check);
}
#endif /* LWLIB_WIDGETS_ATHENA */
lw_internal_update_other_instances (widget, closure, call_data);
@@ -549,11 +529,7 @@ xaw_generic_callback (Widget widget, XtP
#if 0
user_data = NULL;
- {
- Arg al [1];
- XtSetArg (al [0], XtNuserData, &user_data);
- XtGetValues (widget, al, 1);
- }
+ Xt_GET_VALUE (widget, XtNuserData, &user_data);
#else
/* Damn! Athena doesn't give us a way to hang our own data on the
buttons, so we have to go find it... I guess this assumes that
@@ -594,11 +570,10 @@ wm_delete_window (Widget shell, XtPointe
LWLIB_ID id;
Widget *kids = 0;
Widget widget;
- Arg al [1];
+
if (! XtIsSubclass (shell, shellWidgetClass))
abort ();
- XtSetArg (al [0], XtNchildren, &kids);
- XtGetValues (shell, al, 1);
+ Xt_GET_VALUE (shell, XtNchildren, &kids);
if (!kids || !*kids) abort ();
for (widget = *kids;
@@ -697,11 +672,11 @@ xaw_create_scrollbar (widget_instance *i
top-level aware of this so that people could have a border but so
few people use the Athena scrollbar now that it really isn't
worth the effort, at least not at the moment. */
- XtSetArg (av [ac], XtNborderWidth, 0); ac++;
- XtSetArg (av [ac], XtNorientation,
- vertical ? XtorientVertical : XtorientHorizontal); ac++;
- XtSetArg (av [ac], "jumpProc", jumpCallbacks); ac++;
- XtSetArg (av [ac], "scrollProc", scrollCallbacks); ac++;
+ Xt_SET_ARG (av [ac], XtNborderWidth, 0); ac++;
+ Xt_SET_ARG (av [ac], XtNorientation,
+ vertical ? XtorientVertical : XtorientHorizontal); ac++;
+ Xt_SET_ARG (av [ac], "jumpProc", jumpCallbacks); ac++;
+ Xt_SET_ARG (av [ac], "scrollProc", scrollCallbacks); ac++;
return XtCreateWidget (instance->info->name, scrollbarWidgetClass,
instance->parent, av, ac);
@@ -730,13 +705,13 @@ xaw_create_button (widget_instance *inst
Widget button = 0;
widget_value* val = instance->info->val;
- XtSetArg (al [ac], XtNsensitive, val->enabled); ac++;
- XtSetArg (al [ac], XtNmappedWhenManaged, FALSE); ac++;
- XtSetArg (al [ac], XtNjustify, XtJustifyCenter); ac++;
+ Xt_SET_ARG (al [ac], XtNsensitive, val->enabled); ac++;
+ Xt_SET_ARG (al [ac], XtNmappedWhenManaged, FALSE); ac++;
+ Xt_SET_ARG (al [ac], XtNjustify, XtJustifyCenter); ac++;
/* The highlight doesn't appear to be dynamically set which makes it
look ugly. I think this may be a LessTif bug but for now we just
get rid of it. */
- XtSetArg (al [ac], XtNhighlightThickness, (Dimension)0);ac++;
+ Xt_SET_ARG (al [ac], XtNhighlightThickness, (Dimension)0); ac++;
/* add any args the user supplied for creation time */
lw_add_value_args_to_args (val, al, &ac);
@@ -749,7 +724,7 @@ xaw_create_button (widget_instance *inst
{
if (val->type == TOGGLE_TYPE || val->type == RADIO_TYPE)
{
- XtSetArg (al [ac], XtNstate, val->selected); ac++;
+ Xt_SET_ARG (al [ac], XtNstate, val->selected); ac++;
button = XtCreateWidget
(val->name,
val->type == TOGGLE_TYPE ? checkboxWidgetClass : radioWidgetClass,
@@ -783,9 +758,9 @@ xaw_create_label (Widget parent, widget_
int ac = 0;
Widget label = 0;
- XtSetArg (al [ac], XtNsensitive, val->enabled); ac++;
- XtSetArg (al [ac], XtNmappedWhenManaged, FALSE); ac++;
- XtSetArg (al [ac], XtNjustify, XtJustifyCenter); ac++;
+ Xt_SET_ARG (al [ac], XtNsensitive, val->enabled); ac++;
+ Xt_SET_ARG (al [ac], XtNmappedWhenManaged, FALSE); ac++;
+ Xt_SET_ARG (al [ac], XtNjustify, XtJustifyCenter); ac++;
/* add any args the user supplied for creation time */
lw_add_value_args_to_args (val, al, &ac);
@@ -868,20 +843,20 @@ xaw_create_progress (widget_instance *in
#if 0 /* This looks too awful, although more correct. */
if (!val->call_data)
{
- XtSetArg (al [ac], XtNsensitive, False); ac++;
+ Xt_SET_ARG (al [ac], XtNsensitive, False); ac++;
}
else
{
- XtSetArg (al [ac], XtNsensitive, val->enabled); ac++;
+ Xt_SET_ARG (al [ac], XtNsensitive, val->enabled); ac++;
}
#else
- XtSetArg (al [ac], XtNsensitive, True); ac++;
-#endif
-
- XtSetArg (al [ac], XtNmappedWhenManaged, FALSE); ac++;
- XtSetArg (al [ac], XtNorientation, XtorientHorizontal); ac++;
- XtSetArg (al [ac], XtNhighlightThickness, (Dimension)0);ac++;
- XtSetArg (al [ac], XtNntics, (Cardinal)10);ac++;
+ Xt_SET_ARG (al [ac], XtNsensitive, True); ac++;
+#endif
+
+ Xt_SET_ARG (al [ac], XtNmappedWhenManaged, FALSE); ac++;
+ Xt_SET_ARG (al [ac], XtNorientation, XtorientHorizontal); ac++;
+ Xt_SET_ARG (al [ac], XtNhighlightThickness, (Dimension)0); ac++;
+ Xt_SET_ARG (al [ac], XtNntics, (Cardinal)10); ac++;
/* add any args the user supplied for creation time */
lw_add_value_args_to_args (val, al, &ac);
@@ -915,18 +890,18 @@ xaw_create_text_field (widget_instance *
Widget text = 0;
widget_value* val = instance->info->val;
- XtSetArg (al [ac], XtNsensitive, val->enabled); ac++;
- XtSetArg (al [ac], XtNmappedWhenManaged, FALSE); ac++;
- XtSetArg (al [ac], XtNhighlightThickness, (Dimension)0); ac++;
- XtSetArg (al [ac], XtNtype, XawAsciiString); ac++;
- XtSetArg (al [ac], XtNeditType, XawtextEdit); ac++;
- XtSetArg (al [ac], XtNuseStringInPlace, False); ac++;
+ Xt_SET_ARG (al [ac], XtNsensitive, val->enabled); ac++;
+ Xt_SET_ARG (al [ac], XtNmappedWhenManaged, FALSE); ac++;
+ Xt_SET_ARG (al [ac], XtNhighlightThickness, (Dimension)0); ac++;
+ Xt_SET_ARG (al [ac], XtNtype, XawAsciiString); ac++;
+ Xt_SET_ARG (al [ac], XtNeditType, XawtextEdit); ac++;
+ Xt_SET_ARG (al [ac], XtNuseStringInPlace, False); ac++;
#if 0
- XtSetArg (al [ac], XtNlength, TEXT_BUFFER_SIZE); ac++;
+ Xt_SET_ARG (al [ac], XtNlength, TEXT_BUFFER_SIZE); ac++;
#endif
if (val->value)
{
- XtSetArg (al [ac], XtNstring, val->value); ac++;
+ Xt_SET_ARG (al [ac], XtNstring, val->value); ac++;
}
/* add any args the user supplied for creation time */
@@ -956,8 +931,8 @@ xaw_creation_table [] =
#endif
#ifdef LWLIB_WIDGETS_ATHENA
{"button", xaw_create_button },
- { "label", xaw_create_label_field },
- {"text-field", xaw_create_text_field },
+ {"label", xaw_create_label_field },
+ {"text-field", xaw_create_text_field },
{"progress", xaw_create_progress },
#endif
{NULL, NULL}
diff -r 03ba50f7ecd7fb0dee997f30f1f1b7af746c7493 -r 726060ee587c536ac95384a055029092ea091231 lwlib/lwlib-Xlw.c
--- a/lwlib/lwlib-Xlw.c Wed Oct 29 04:02:05 2008 +0900
+++ b/lwlib/lwlib-Xlw.c Wed Oct 29 04:06:33 2008 +0900
@@ -122,7 +122,7 @@ xlw_create_menubar (widget_instance* ins
Arg al [1];
Widget widget;
- XtSetArg (al [0], XtNmenu, instance->info->val);
+ Xt_SET_ARG (al [0], XtNmenu, instance->info->val);
widget = XtCreateWidget (instance->info->name, xlwMenuWidgetClass,
instance->parent, al, 1);
XtAddCallback (widget, XtNopen, pre_hook, (XtPointer)instance);
@@ -139,8 +139,8 @@ xlw_create_popup_menu (widget_instance*
popup_shell = XtCreatePopupShell (instance->info->name,
overrideShellWidgetClass,
instance->parent, NULL, 0);
- XtSetArg (al [0], XtNmenu, instance->info->val);
- XtSetArg (al [1], XtNhorizontal, False);
+ Xt_SET_ARG (al [0], XtNmenu, instance->info->val);
+ Xt_SET_ARG (al [1], XtNhorizontal, False);
widget = XtCreateManagedWidget ("popup", xlwMenuWidgetClass,
popup_shell, al, 2);
XtAddCallback (widget, XtNselect, pick_hook, (XtPointer)instance);
@@ -234,20 +234,20 @@ xlw_create_scrollbar (widget_instance *i
callbacks[0].closure = (XtPointer) instance;
- XtSetArg (al[ac], XmNminimum, 1); ac++;
- XtSetArg (al[ac], XmNmaximum, INT_MAX); ac++;
- XtSetArg (al[ac], XmNincrement, 1); ac++;
- XtSetArg (al[ac], XmNpageIncrement, 1); ac++;
- XtSetArg (al[ac], XmNorientation, (vertical ? XmVERTICAL : XmHORIZONTAL)); ac++;
-
- XtSetArg (al[ac], XmNdecrementCallback, callbacks); ac++;
- XtSetArg (al[ac], XmNdragCallback, callbacks); ac++;
- XtSetArg (al[ac], XmNincrementCallback, callbacks); ac++;
- XtSetArg (al[ac], XmNpageDecrementCallback, callbacks); ac++;
- XtSetArg (al[ac], XmNpageIncrementCallback, callbacks); ac++;
- XtSetArg (al[ac], XmNtoBottomCallback, callbacks); ac++;
- XtSetArg (al[ac], XmNtoTopCallback, callbacks); ac++;
- XtSetArg (al[ac], XmNvalueChangedCallback, callbacks); ac++;
+ Xt_SET_ARG (al[ac], XmNminimum, 1); ac++;
+ Xt_SET_ARG (al[ac], XmNmaximum, INT_MAX); ac++;
+ Xt_SET_ARG (al[ac], XmNincrement, 1); ac++;
+ Xt_SET_ARG (al[ac], XmNpageIncrement, 1); ac++;
+ Xt_SET_ARG (al[ac], XmNorientation, (vertical ? XmVERTICAL : XmHORIZONTAL)); ac++;
+
+ Xt_SET_ARG (al[ac], XmNdecrementCallback, callbacks); ac++;
+ Xt_SET_ARG (al[ac], XmNdragCallback, callbacks); ac++;
+ Xt_SET_ARG (al[ac], XmNincrementCallback, callbacks); ac++;
+ Xt_SET_ARG (al[ac], XmNpageDecrementCallback, callbacks); ac++;
+ Xt_SET_ARG (al[ac], XmNpageIncrementCallback, callbacks); ac++;
+ Xt_SET_ARG (al[ac], XmNtoBottomCallback, callbacks); ac++;
+ Xt_SET_ARG (al[ac], XmNtoTopCallback, callbacks); ac++;
+ Xt_SET_ARG (al[ac], XmNvalueChangedCallback, callbacks); ac++;
return XtCreateWidget (instance->info->name, xlwScrollBarWidgetClass,
instance->parent, al, ac);
@@ -278,15 +278,15 @@ xlw_update_scrollbar (widget_instance *U
Arg al [4];
/* First size and position the scrollbar widget. */
- XtSetArg (al [0], XtNx, data->scrollbar_x);
- XtSetArg (al [1], XtNy, data->scrollbar_y);
- XtSetArg (al [2], XtNwidth, data->scrollbar_width);
- XtSetArg (al [3], XtNheight, data->scrollbar_height);
+ Xt_SET_ARG (al [0], XtNx, data->scrollbar_x);
+ Xt_SET_ARG (al [1], XtNy, data->scrollbar_y);
+ Xt_SET_ARG (al [2], XtNwidth, data->scrollbar_width);
+ Xt_SET_ARG (al [3], XtNheight, data->scrollbar_height);
XtSetValues (widget, al, 4);
/* Now size the scrollbar's slider. */
- XtSetArg (al [0], XmNsliderSize, &widget_sliderSize);
- XtSetArg (al [1], XmNvalue, &widget_val);
+ Xt_SET_ARG (al [0], XmNsliderSize, &widget_sliderSize);
+ Xt_SET_ARG (al [1], XmNvalue, &widget_val);
XtGetValues (widget, al, 2);
percent = (double) data->slider_size /
@@ -382,9 +382,9 @@ xlw_create_tab_control (widget_instance
Widget tab = 0;
widget_value* val = instance->info->val;
- XtSetArg (al [ac], XtNsensitive, val->enabled); ac++;
- XtSetArg (al [ac], XtNmappedWhenManaged, False); ac++;
- XtSetArg (al [ac], XtNorientation, XtorientHorizontal); ac++;
+ Xt_SET_ARG (al [ac], XtNsensitive, val->enabled); ac++;
+ Xt_SET_ARG (al [ac], XtNmappedWhenManaged, False); ac++;
+ Xt_SET_ARG (al [ac], XtNorientation, XtorientHorizontal); ac++;
/* add any args the user supplied for creation time */
lw_add_value_args_to_args (val, al, &ac);
@@ -406,7 +406,7 @@ static void build_tabs_in_widget (widget
Arg al[1];
/* Children are always invisible, don't permit resizing. */
- XtSetArg (al[0], XtNresizable, False);
+ Xt_SET_ARG (al[0], XtNresizable, False);
for (cur = val; cur; cur = cur->next)
{
@@ -479,8 +479,8 @@ xlw_create_clip_window (widget_instance
Widget clip = 0;
widget_value* val = instance->info->val;
- XtSetArg (al [ac], XtNmappedWhenManaged, False); ac++;
- XtSetArg (al [ac], XtNsensitive, True); ac++;
+ Xt_SET_ARG (al [ac], XtNmappedWhenManaged, False); ac++;
+ Xt_SET_ARG (al [ac], XtNsensitive, True); ac++;
/* add any args the user supplied for creation time */
lw_add_value_args_to_args (val, al, &ac);
@@ -557,13 +557,11 @@ xlw_update_one_widget (widget_instance*
else if (class_ == xlwMenuWidgetClass)
{
XlwMenuWidget mw;
- Arg al [1];
if (XtIsShell (widget))
mw = (XlwMenuWidget)((CompositeWidget)widget)->composite.children [0];
else
mw = (XlwMenuWidget)widget;
- XtSetArg (al [0], XtNmenu, val);
- XtSetValues (widget, al, 1); /* #### mw unused! */
+ Xt_SET_VALUE (widget, XtNmenu, val); /* #### mw unused! */
}
#endif
#ifdef LWLIB_SCROLLBARS_LUCID
diff -r 03ba50f7ecd7fb0dee997f30f1f1b7af746c7493 -r 726060ee587c536ac95384a055029092ea091231 lwlib/lwlib-Xm.c
--- a/lwlib/lwlib-Xm.c Wed Oct 29 04:02:05 2008 +0900
+++ b/lwlib/lwlib-Xm.c Wed Oct 29 04:06:33 2008 +0900
@@ -216,8 +216,7 @@ xm_update_label (widget_instance* UNUSED
int type;
/* Don't clobber pixmap types. */
- XtSetArg (al [0], XmNlabelType, &type);
- XtGetValues (widget, al, 1);
+ Xt_GET_VALUE (widget, XmNlabelType, &type);
if (type == XmPIXMAP)
return;
@@ -280,14 +279,14 @@ xm_update_label (widget_instance* UNUSED
}
}
- XtSetArg (al [ac], XmNlabelString, built_string); ac++;
- XtSetArg (al [ac], XmNlabelType, XmSTRING); ac++;
+ Xt_SET_ARG (al [ac], XmNlabelString, built_string); ac++;
+ Xt_SET_ARG (al [ac], XmNlabelType, XmSTRING); ac++;
}
if (val->key)
{
key_string = XmStringCreateLtoR (val->key, XmSTRING_DEFAULT_CHARSET);
- XtSetArg (al [ac], XmNacceleratorText, key_string); ac++;
+ Xt_SET_ARG (al [ac], XmNacceleratorText, key_string); ac++;
}
if (ac)
@@ -342,9 +341,7 @@ xm_update_pushbutton (widget_instance* i
xm_update_pushbutton (widget_instance* instance, Widget widget,
widget_value* UNUSED (val))
{
- Arg al [1];
- XtSetArg (al [0], XmNalignment, XmALIGNMENT_CENTER);
- XtSetValues (widget, al, 1);
+ Xt_SET_VALUE (widget, XmNalignment, XmALIGNMENT_CENTER);
XtRemoveAllCallbacks (widget, XmNactivateCallback);
XtAddCallback (widget, XmNactivateCallback, xm_generic_callback, instance);
}
@@ -360,21 +357,21 @@ xm_update_progress (widget_instance* UNU
Dimension width = 0;
if (!val->call_data)
{
- XtSetArg (al [ac], XmNeditable, False); ac++;
+ Xt_SET_ARG (al [ac], XmNeditable, False); ac++;
}
else
{
- XtSetArg (al [ac], XmNeditable, val->enabled); ac++;
- }
- height = (Dimension)lw_get_value_arg (val, XtNheight);
- width = (Dimension)lw_get_value_arg (val, XtNwidth);
+ Xt_SET_ARG (al [ac], XmNeditable, val->enabled); ac++;
+ }
+ height = (Dimension) lw_get_value_arg (val, XtNheight);
+ width = (Dimension) lw_get_value_arg (val, XtNwidth);
if (height > 0)
{
- XtSetArg (al [ac], XmNscaleHeight, height); ac++;
+ Xt_SET_ARG (al [ac], XmNscaleHeight, height); ac++;
}
if (width > 0)
{
- XtSetArg (al [ac], XmNscaleWidth, width); ac++;
+ Xt_SET_ARG (al [ac], XmNscaleWidth, width); ac++;
}
XtSetValues (scale, al, ac);
@@ -419,8 +416,8 @@ xm_update_toggle (widget_instance* insta
XtRemoveAllCallbacks (widget, XmNvalueChangedCallback);
XtAddCallback (widget, XmNvalueChangedCallback, xm_generic_callback,
instance);
- XtSetArg (al [0], XmNset, val->selected);
- XtSetArg (al [1], XmNalignment, XmALIGNMENT_BEGINNING);
+ Xt_SET_ARG (al [0], XmNset, val->selected);
+ Xt_SET_ARG (al [1], XmNalignment, XmALIGNMENT_BEGINNING);
XtSetValues (widget, al, 1);
}
@@ -447,8 +444,8 @@ xm_update_radiobox (widget_instance* ins
if (toggle)
{
Arg al [2];
- XtSetArg (al [0], XmNsensitive, cur->enabled);
- XtSetArg (al [1], XmNset, (!val->value && cur->selected ? cur->selected : False));
+ Xt_SET_ARG (al [0], XmNsensitive, cur->enabled);
+ Xt_SET_ARG (al [1], XmNset, (!val->value && cur->selected ? cur->selected : False));
XtSetValues (toggle, al, 2);
}
}
@@ -458,11 +455,7 @@ xm_update_radiobox (widget_instance* ins
{
toggle = XtNameToWidget (widget, val->value);
if (toggle)
- {
- Arg al [1];
- XtSetArg (al [0], XmNset, True);
- XtSetValues (toggle, al, 1);
- }
+ Xt_SET_VALUE (toggle, XmNset, True);
}
}
@@ -511,8 +504,7 @@ make_menu_in_widget (widget_instance* in
children = (Widget*)XtMalloc (num_children * sizeof (Widget));
/* tricky way to know if this RowColumn is a menubar or a pulldown... */
- XtSetArg (al [0], XmNisHomogeneous, &menubar_p);
- XtGetValues (widget, al, 1);
+ Xt_GET_VALUE (widget, XmNisHomogeneous, &menubar_p);
/* add the unmap callback for popups and pulldowns */
/*** this sounds bogus ***/
@@ -528,9 +520,9 @@ make_menu_in_widget (widget_instance* in
{
ac = 0;
button = 0;
- XtSetArg (al [ac], XmNsensitive, cur->enabled); ac++;
- XtSetArg (al [ac], XmNalignment, XmALIGNMENT_BEGINNING); ac++;
- XtSetArg (al [ac], XmNuserData, cur->call_data); ac++;
+ Xt_SET_ARG (al [ac], XmNsensitive, cur->enabled); ac++;
+ Xt_SET_ARG (al [ac], XmNalignment, XmALIGNMENT_BEGINNING); ac++;
+ Xt_SET_ARG (al [ac], XmNuserData, cur->call_data); ac++;
switch (cur->type)
{
@@ -545,14 +537,14 @@ make_menu_in_widget (widget_instance* in
/* #### - xlwmenu.h supports several types that motif does
not. Also, motif supports pixmaps w/ type NO_LINE and
lwlib provides no way to access that functionality. --Stig */
- XtSetArg (al [ac], XmNseparatorType, cur->value), ac++;
+ Xt_SET_ARG (al [ac], XmNseparatorType, cur->value); ac++;
}
button = XmCreateSeparator (widget, "separator", al, ac);
break;
case CASCADE_TYPE:
menu = XmCreatePulldownMenu (widget, "pulldown", NULL, 0);
make_menu_in_widget (instance, menu, cur->contents);
- XtSetArg (al [ac], XmNsubMenuId, menu); ac++;
+ Xt_SET_ARG (al [ac], XmNsubMenuId, menu); ac++;
button = XmCreateCascadeButton (widget, cur->name, al, ac);
xm_safe_update_label (instance, button, cur);
@@ -567,10 +559,10 @@ make_menu_in_widget (widget_instance* in
button = XmCreateLabel (widget, cur->name, al, ac);
else if (cur->type == TOGGLE_TYPE || cur->type == RADIO_TYPE)
{
- XtSetArg (al [ac], XmNindicatorType,
+ Xt_SET_ARG (al [ac], XmNindicatorType,
(cur->type == TOGGLE_TYPE ?
- XmN_OF_MANY : XmONE_OF_MANY)); ac++;
- XtSetArg (al [ac], XmNvisibleWhenOff, True); ac++;
+ XmN_OF_MANY : XmONE_OF_MANY)); ac++;
+ Xt_SET_ARG (al [ac], XmNvisibleWhenOff, True); ac++;
button = XmCreateToggleButtonGadget (widget, cur->name, al, ac);
}
else
@@ -597,11 +589,7 @@ make_menu_in_widget (widget_instance* in
height if you don't manage them until after you set this and as a
bonus the Help menu ends up where it is supposed to. */
if (button)
- {
- ac = 0;
- XtSetArg (al [ac], XmNmenuHelpWidget, button); ac++;
- XtSetValues (widget, al, ac);
- }
+ Xt_SET_VALUE (widget, XmNmenuHelpWidget, button);
if (num_children)
XtManageChildren (children, num_children);
@@ -623,8 +611,8 @@ update_one_menu_entry (widget_instance*
/* update the sensitivity and userdata */
/* Common to all widget types */
- XtSetArg (al [0], XmNsensitive, val->enabled);
- XtSetArg (al [1], XmNuserData, val->call_data);
+ Xt_SET_ARG (al [0], XmNsensitive, val->enabled);
+ Xt_SET_ARG (al [1], XmNuserData, val->call_data);
XtSetValues (widget, al, 2);
/* update the menu button as a label. */
@@ -642,8 +630,7 @@ update_one_menu_entry (widget_instance*
/* update the pulldown/pullaside as needed */
menu = NULL;
- XtSetArg (al [0], XmNsubMenuId, &menu);
- XtGetValues (widget, al, 1);
+ Xt_GET_VALUE (widget, XmNsubMenuId, &menu);
contents = val->contents;
@@ -653,16 +640,12 @@ update_one_menu_entry (widget_instance*
{
menu = XmCreatePulldownMenu (widget, "pulldown", NULL, 0);
make_menu_in_widget (instance, menu, contents);
- ac = 0;
- XtSetArg (al [ac], XmNsubMenuId, menu); ac++;
- XtSetValues (widget, al, ac);
+ Xt_SET_VALUE (widget, XmNsubMenuId, menu);
}
}
else if (!contents)
{
- ac = 0;
- XtSetArg (al [ac], XmNsubMenuId, NULL); ac++;
- XtSetValues (widget, al, ac);
+ Xt_SET_VALUE (widget, XmNsubMenuId, NULL);
XtDestroyWidget (menu);
}
else if (deep_p && contents->change != NO_CHANGE)
@@ -772,15 +755,15 @@ xm_update_scrollbar (widget_instance *in
Arg al [4];
/* First size and position the scrollbar widget. */
- XtSetArg (al [0], XtNx, data->scrollbar_x);
- XtSetArg (al [1], XtNy, data->scrollbar_y);
- XtSetArg (al [2], XtNwidth, data->scrollbar_width);
- XtSetArg (al [3], XtNheight, data->scrollbar_height);
+ Xt_SET_ARG (al [0], XtNx, data->scrollbar_x);
+ Xt_SET_ARG (al [1], XtNy, data->scrollbar_y);
+ Xt_SET_ARG (al [2], XtNwidth, data->scrollbar_width);
+ Xt_SET_ARG (al [3], XtNheight, data->scrollbar_height);
XtSetValues (widget, al, 4);
/* Now size the scrollbar's slider. */
- XtSetArg (al [0], XmNsliderSize, &widget_sliderSize);
- XtSetArg (al [1], XmNvalue, &widget_val);
+ Xt_SET_ARG (al [0], XmNsliderSize, &widget_sliderSize);
+ Xt_SET_ARG (al [1], XmNvalue, &widget_val);
XtGetValues (widget, al, 2);
percent = (double) data->slider_size /
@@ -845,8 +828,8 @@ xm_update_one_widget (widget_instance* i
val->edited = False;
/* Common to all widget types */
- XtSetArg (al [ac], XmNsensitive, val->enabled); ac++;
- XtSetArg (al [ac], XmNuserData, val->call_data); ac++;
+ Xt_SET_ARG (al [ac], XmNsensitive, val->enabled); ac++;
+ Xt_SET_ARG (al [ac], XmNuserData, val->call_data); ac++;
XtSetValues (widget, al, ac);
#if defined (LWLIB_DIALOGS_MOTIF) || defined (LWLIB_MENUBARS_MOTIF) || defined (LWLIB_WIDGETS_MOTIF)
@@ -875,8 +858,7 @@ xm_update_one_widget (widget_instance* i
{
Boolean radiobox = 0;
- XtSetArg (al [0], XmNradioBehavior, &radiobox);
- XtGetValues (widget, al, 1);
+ Xt_GET_VALUE (widget, XmNradioBehavior, &radiobox);
if (radiobox)
xm_update_radiobox (instance, widget, val);
@@ -938,9 +920,7 @@ xm_update_one_value (widget_instance* in
if (class_ == xmToggleButtonWidgetClass || class_ == xmToggleButtonGadgetClass)
{
- Arg al [1];
- XtSetArg (al [0], XmNset, &val->selected);
- XtGetValues (widget, al, 1);
+ Xt_GET_VALUE (widget, XmNset, &val->selected);
val->edited = True;
}
else if (class_ == xmTextWidgetClass)
@@ -960,11 +940,8 @@ xm_update_one_value (widget_instance* in
else if (class_ == xmRowColumnWidgetClass)
{
Boolean radiobox = 0;
- {
- Arg al [1];
- XtSetArg (al [0], XmNradioBehavior, &radiobox);
- XtGetValues (widget, al, 1);
- }
+
+ Xt_GET_VALUE (widget, XmNradioBehavior, &radiobox);
if (radiobox)
{
@@ -974,10 +951,8 @@ xm_update_one_value (widget_instance* in
{
int set = False;
Widget toggle = radio->composite.children [i];
- Arg al [1];
-
- XtSetArg (al [0], XmNset, &set);
- XtGetValues (toggle, al, 1);
+
+ Xt_GET_VALUE (toggle, XmNset, &set);
if (set)
{
if (val->value)
@@ -1130,42 +1105,42 @@ make_dialog (char* UNUSED (name), Widget
if (pop_up_p)
{
ac = 0;
- XtSetArg(al[ac], XmNtitle, shell_title); ac++;
- XtSetArg(al[ac], XtNallowShellResize, True); ac++;
- XtSetArg(al[ac], XmNdeleteResponse, XmUNMAP); ac++;
+ Xt_SET_ARG(al[ac], XmNtitle, shell_title); ac++;
+ Xt_SET_ARG(al[ac], XtNallowShellResize, True); ac++;
+ Xt_SET_ARG(al[ac], XmNdeleteResponse, XmUNMAP); ac++;
result = XmCreateDialogShell (parent, "dialog", al, ac);
- XtSetArg(al[ac], XmNautoUnmanage, FALSE); ac++;
-/* XtSetArg(al[ac], XmNautoUnmanage, TRUE); ac++; */ /* ####is this ok? */
- XtSetArg(al[ac], XmNnavigationType, XmTAB_GROUP); ac++;
+ Xt_SET_ARG(al[ac], XmNautoUnmanage, FALSE); ac++;
+/* Xt_SET_ARG(al[ac], XmNautoUnmanage, TRUE); ac++; */ /* ####is this ok? */
+ Xt_SET_ARG(al[ac], XmNnavigationType, XmTAB_GROUP); ac++;
form = XmCreateForm (result, (char *) shell_title, al, ac);
}
else
{
ac = 0;
- XtSetArg(al[ac], XmNautoUnmanage, FALSE); ac++;
- XtSetArg(al[ac], XmNnavigationType, XmTAB_GROUP); ac++;
+ Xt_SET_ARG(al[ac], XmNautoUnmanage, FALSE); ac++;
+ Xt_SET_ARG(al[ac], XmNnavigationType, XmTAB_GROUP); ac++;
form = XmCreateForm (parent, (char *) shell_title, al, ac);
result = form;
}
ac = 0;
- XtSetArg(al[ac], XmNpacking, XmPACK_COLUMN); ac++;
- XtSetArg(al[ac], XmNorientation, XmVERTICAL); ac++;
- XtSetArg(al[ac], XmNnumColumns, left_buttons + right_buttons + 1); ac++;
- XtSetArg(al[ac], XmNmarginWidth, 0); ac++;
- XtSetArg(al[ac], XmNmarginHeight, 0); ac++;
- XtSetArg(al[ac], XmNspacing, 13); ac++;
- XtSetArg(al[ac], XmNadjustLast, False); ac++;
- XtSetArg(al[ac], XmNalignment, XmALIGNMENT_CENTER); ac++;
- XtSetArg(al[ac], XmNisAligned, True); ac++;
- XtSetArg(al[ac], XmNtopAttachment, XmATTACH_NONE); ac++;
- XtSetArg(al[ac], XmNbottomAttachment, XmATTACH_FORM); ac++;
- XtSetArg(al[ac], XmNbottomOffset, 13); ac++;
- XtSetArg(al[ac], XmNleftAttachment, XmATTACH_FORM); ac++;
- XtSetArg(al[ac], XmNleftOffset, 13); ac++;
- XtSetArg(al[ac], XmNrightAttachment, XmATTACH_FORM); ac++;
- XtSetArg(al[ac], XmNrightOffset, 13); ac++;
+ Xt_SET_ARG(al[ac], XmNpacking, XmPACK_COLUMN); ac++;
+ Xt_SET_ARG(al[ac], XmNorientation, XmVERTICAL); ac++;
+ Xt_SET_ARG(al[ac], XmNnumColumns, left_buttons + right_buttons + 1); ac++;
+ Xt_SET_ARG(al[ac], XmNmarginWidth, 0); ac++;
+ Xt_SET_ARG(al[ac], XmNmarginHeight, 0); ac++;
+ Xt_SET_ARG(al[ac], XmNspacing, 13); ac++;
+ Xt_SET_ARG(al[ac], XmNadjustLast, False); ac++;
+ Xt_SET_ARG(al[ac], XmNalignment, XmALIGNMENT_CENTER); ac++;
+ Xt_SET_ARG(al[ac], XmNisAligned, True); ac++;
+ Xt_SET_ARG(al[ac], XmNtopAttachment, XmATTACH_NONE); ac++;
+ Xt_SET_ARG(al[ac], XmNbottomAttachment, XmATTACH_FORM); ac++;
+ Xt_SET_ARG(al[ac], XmNbottomOffset, 13); ac++;
+ Xt_SET_ARG(al[ac], XmNleftAttachment, XmATTACH_FORM); ac++;
+ Xt_SET_ARG(al[ac], XmNleftOffset, 13); ac++;
+ Xt_SET_ARG(al[ac], XmNrightAttachment, XmATTACH_FORM); ac++;
+ Xt_SET_ARG(al[ac], XmNrightOffset, 13); ac++;
row = XmCreateRowColumn (form, "row", al, ac);
n_children = 0;
@@ -1176,10 +1151,10 @@ make_dialog (char* UNUSED (name), Widget
ac = 0;
if (i == 0)
{
- XtSetArg(al[ac], XmNhighlightThickness, 1); ac++;
- XtSetArg(al[ac], XmNshowAsDefault, TRUE); ac++;
+ Xt_SET_ARG(al[ac], XmNhighlightThickness, 1); ac++;
+ Xt_SET_ARG(al[ac], XmNshowAsDefault, TRUE); ac++;
}
- XtSetArg(al[ac], XmNnavigationType, XmTAB_GROUP); ac++;
+ Xt_SET_ARG(al[ac], XmNnavigationType, XmTAB_GROUP); ac++;
children [n_children] = XmCreatePushButton (row, button_name, al, ac);
DO_DND_KLUDGE (children [n_children]);
@@ -1187,7 +1162,7 @@ make_dialog (char* UNUSED (name), Widget
{
button = children [n_children];
ac = 0;
- XtSetArg(al[ac], XmNdefaultButton, button); ac++;
+ Xt_SET_ARG(al[ac], XmNdefaultButton, button); ac++;
XtSetValues (row, al, ac);
#ifdef ARMANDACTIVATE_KLUDGE /* See comment above */
@@ -1204,9 +1179,8 @@ make_dialog (char* UNUSED (name), Widget
/* invisible separator button */
ac = 0;
- XtSetArg (al[ac], XmNmappedWhenManaged, FALSE); ac++;
- children [n_children] = XmCreateLabel (row, "separator_button",
- al, ac);
+ Xt_SET_ARG (al[ac], XmNmappedWhenManaged, FALSE); ac++;
+ children [n_children] = XmCreateLabel (row, "separator_button", al, ac);
DO_DND_KLUDGE (children [n_children]);
n_children++;
@@ -1215,7 +1189,7 @@ make_dialog (char* UNUSED (name), Widget
char button_name [16];
sprintf (button_name, "button%d", left_buttons + i + 1);
ac = 0;
- XtSetArg(al[ac], XmNnavigationType, XmTAB_GROUP); ac++;
+ Xt_SET_ARG(al[ac], XmNnavigationType, XmTAB_GROUP); ac++;
children [n_children] = XmCreatePushButton (row, button_name, al, ac);
DO_DND_KLUDGE (children [n_children]);
if (! button) button = children [n_children];
@@ -1225,53 +1199,53 @@ make_dialog (char* UNUSED (name), Widget
XtManageChildren (children, n_children);
ac = 0;
- XtSetArg(al[ac], XmNtopAttachment, XmATTACH_NONE); ac++;
- XtSetArg(al[ac], XmNbottomAttachment, XmATTACH_WIDGET); ac++;
- XtSetArg(al[ac], XmNbottomOffset, 13); ac++;
- XtSetArg(al[ac], XmNbottomWidget, row); ac++;
- XtSetArg(al[ac], XmNleftAttachment, XmATTACH_FORM); ac++;
- XtSetArg(al[ac], XmNleftOffset, 0); ac++;
- XtSetArg(al[ac], XmNrightAttachment, XmATTACH_FORM); ac++;
- XtSetArg(al[ac], XmNrightOffset, 0); ac++;
+ Xt_SET_ARG(al[ac], XmNtopAttachment, XmATTACH_NONE); ac++;
+ Xt_SET_ARG(al[ac], XmNbottomAttachment, XmATTACH_WIDGET); ac++;
+ Xt_SET_ARG(al[ac], XmNbottomOffset, 13); ac++;
+ Xt_SET_ARG(al[ac], XmNbottomWidget, row); ac++;
+ Xt_SET_ARG(al[ac], XmNleftAttachment, XmATTACH_FORM); ac++;
+ Xt_SET_ARG(al[ac], XmNleftOffset, 0); ac++;
+ Xt_SET_ARG(al[ac], XmNrightAttachment, XmATTACH_FORM); ac++;
+ Xt_SET_ARG(al[ac], XmNrightOffset, 0); ac++;
separator = XmCreateSeparator (form, "", al, ac);
ac = 0;
- XtSetArg(al[ac], XmNlabelType, XmPIXMAP); ac++;
- XtSetArg(al[ac], XmNtopAttachment, XmATTACH_FORM); ac++;
- XtSetArg(al[ac], XmNtopOffset, 13); ac++;
- XtSetArg(al[ac], XmNbottomAttachment, XmATTACH_NONE); ac++;
- XtSetArg(al[ac], XmNleftAttachment, XmATTACH_FORM); ac++;
- XtSetArg(al[ac], XmNleftOffset, 13); ac++;
- XtSetArg(al[ac], XmNrightAttachment, XmATTACH_NONE); ac++;
+ Xt_SET_ARG(al[ac], XmNlabelType, XmPIXMAP); ac++;
+ Xt_SET_ARG(al[ac], XmNtopAttachment, XmATTACH_FORM); ac++;
+ Xt_SET_ARG(al[ac], XmNtopOffset, 13); ac++;
+ Xt_SET_ARG(al[ac], XmNbottomAttachment, XmATTACH_NONE); ac++;
+ Xt_SET_ARG(al[ac], XmNleftAttachment, XmATTACH_FORM); ac++;
+ Xt_SET_ARG(al[ac], XmNleftOffset, 13); ac++;
+ Xt_SET_ARG(al[ac], XmNrightAttachment, XmATTACH_NONE); ac++;
icon = XmCreateLabel (form, (char *) icon_name, al, ac);
DO_DND_KLUDGE (icon);
ac = 0;
- XtSetArg(al[ac], XmNmappedWhenManaged, FALSE); ac++;
- XtSetArg(al[ac], XmNtopAttachment, XmATTACH_WIDGET); ac++;
- XtSetArg(al[ac], XmNtopOffset, 6); ac++;
- XtSetArg(al[ac], XmNtopWidget, icon); ac++;
- XtSetArg(al[ac], XmNbottomAttachment, XmATTACH_WIDGET); ac++;
- XtSetArg(al[ac], XmNbottomOffset, 6); ac++;
- XtSetArg(al[ac], XmNbottomWidget, separator); ac++;
- XtSetArg(al[ac], XmNleftAttachment, XmATTACH_NONE); ac++;
- XtSetArg(al[ac], XmNrightAttachment, XmATTACH_NONE); ac++;
+ Xt_SET_ARG(al[ac], XmNmappedWhenManaged, FALSE); ac++;
+ Xt_SET_ARG(al[ac], XmNtopAttachment, XmATTACH_WIDGET); ac++;
+ Xt_SET_ARG(al[ac], XmNtopOffset, 6); ac++;
+ Xt_SET_ARG(al[ac], XmNtopWidget, icon); ac++;
+ Xt_SET_ARG(al[ac], XmNbottomAttachment, XmATTACH_WIDGET); ac++;
+ Xt_SET_ARG(al[ac], XmNbottomOffset, 6); ac++;
+ Xt_SET_ARG(al[ac], XmNbottomWidget, separator); ac++;
+ Xt_SET_ARG(al[ac], XmNleftAttachment, XmATTACH_NONE); ac++;
+ Xt_SET_ARG(al[ac], XmNrightAttachment, XmATTACH_NONE); ac++;
icon_separator = XmCreateLabel (form, "", al, ac);
DO_DND_KLUDGE (icon_separator);
if (text_input_slot)
{
ac = 0;
- XtSetArg(al[ac], XmNcolumns, 50); ac++;
- XtSetArg(al[ac], XmNtopAttachment, XmATTACH_NONE); ac++;
- XtSetArg(al[ac], XmNbottomAttachment, XmATTACH_WIDGET); ac++;
- XtSetArg(al[ac], XmNbottomOffset, 13); ac++;
- XtSetArg(al[ac], XmNbottomWidget, separator); ac++;
- XtSetArg(al[ac], XmNleftAttachment, XmATTACH_WIDGET); ac++;
- XtSetArg(al[ac], XmNleftOffset, 13); ac++;
- XtSetArg(al[ac], XmNleftWidget, icon); ac++;
- XtSetArg(al[ac], XmNrightAttachment, XmATTACH_FORM); ac++;
- XtSetArg(al[ac], XmNrightOffset, 13); ac++;
+ Xt_SET_ARG(al[ac], XmNcolumns, 50); ac++;
+ Xt_SET_ARG(al[ac], XmNtopAttachment, XmATTACH_NONE); ac++;
+ Xt_SET_ARG(al[ac], XmNbottomAttachment, XmATTACH_WIDGET); ac++;
+ Xt_SET_ARG(al[ac], XmNbottomOffset, 13); ac++;
+ Xt_SET_ARG(al[ac], XmNbottomWidget, separator); ac++;
+ Xt_SET_ARG(al[ac], XmNleftAttachment, XmATTACH_WIDGET); ac++;
+ Xt_SET_ARG(al[ac], XmNleftOffset, 13); ac++;
+ Xt_SET_ARG(al[ac], XmNleftWidget, icon); ac++;
+ Xt_SET_ARG(al[ac], XmNrightAttachment, XmATTACH_FORM); ac++;
+ Xt_SET_ARG(al[ac], XmNrightOffset, 13); ac++;
value = XmCreateTextField (form, "value", al, ac);
DO_DND_KLUDGE (value);
}
@@ -1279,19 +1253,19 @@ make_dialog (char* UNUSED (name), Widget
{
Widget radio_butt;
ac = 0;
- XtSetArg(al[ac], XmNmarginWidth, 0); ac++;
- XtSetArg(al[ac], XmNmarginHeight, 0); ac++;
- XtSetArg(al[ac], XmNspacing, 13); ac++;
- XtSetArg(al[ac], XmNalignment, XmALIGNMENT_CENTER); ac++;
- XtSetArg(al[ac], XmNorientation, XmHORIZONTAL); ac++;
- XtSetArg(al[ac], XmNbottomAttachment, XmATTACH_WIDGET); ac++;
- XtSetArg(al[ac], XmNbottomOffset, 13); ac++;
- XtSetArg(al[ac], XmNbottomWidget, separator); ac++;
- XtSetArg(al[ac], XmNleftAttachment, XmATTACH_WIDGET); ac++;
- XtSetArg(al[ac], XmNleftOffset, 13); ac++;
- XtSetArg(al[ac], XmNleftWidget, icon); ac++;
- XtSetArg(al[ac], XmNrightAttachment, XmATTACH_FORM); ac++;
- XtSetArg(al[ac], XmNrightOffset, 13); ac++;
+ Xt_SET_ARG(al[ac], XmNmarginWidth, 0); ac++;
+ Xt_SET_ARG(al[ac], XmNmarginHeight, 0); ac++;
+ Xt_SET_ARG(al[ac], XmNspacing, 13); ac++;
+ Xt_SET_ARG(al[ac], XmNalignment, XmALIGNMENT_CENTER); ac++;
+ Xt_SET_ARG(al[ac], XmNorientation, XmHORIZONTAL); ac++;
+ Xt_SET_ARG(al[ac], XmNbottomAttachment, XmATTACH_WIDGET); ac++;
+ Xt_SET_ARG(al[ac], XmNbottomOffset, 13); ac++;
+ Xt_SET_ARG(al[ac], XmNbottomWidget, separator); ac++;
+ Xt_SET_ARG(al[ac], XmNleftAttachment, XmATTACH_WIDGET); ac++;
+ Xt_SET_ARG(al[ac], XmNleftOffset, 13); ac++;
+ Xt_SET_ARG(al[ac], XmNleftWidget, icon); ac++;
+ Xt_SET_ARG(al[ac], XmNrightAttachment, XmATTACH_FORM); ac++;
+ Xt_SET_ARG(al[ac], XmNrightOffset, 13); ac++;
value = XmCreateRadioBox (form, "radiobutton1", al, ac);
ac = 0;
i = 0;
@@ -1306,16 +1280,16 @@ make_dialog (char* UNUSED (name), Widget
else if (list)
{
ac = 0;
- XtSetArg(al[ac], XmNvisibleItemCount, 5); ac++;
- XtSetArg(al[ac], XmNtopAttachment, XmATTACH_NONE); ac++;
- XtSetArg(al[ac], XmNbottomAttachment, XmATTACH_WIDGET); ac++;
- XtSetArg(al[ac], XmNbottomOffset, 13); ac++;
- XtSetArg(al[ac], XmNbottomWidget, separator); ac++;
- XtSetArg(al[ac], XmNleftAttachment, XmATTACH_WIDGET); ac++;
- XtSetArg(al[ac], XmNleftOffset, 13); ac++;
- XtSetArg(al[ac], XmNleftWidget, icon); ac++;
- XtSetArg(al[ac], XmNrightAttachment, XmATTACH_FORM); ac++;
- XtSetArg(al[ac], XmNrightOffset, 13); ac++;
+ Xt_SET_ARG(al[ac], XmNvisibleItemCount, 5); ac++;
+ Xt_SET_ARG(al[ac], XmNtopAttachment, XmATTACH_NONE); ac++;
+ Xt_SET_ARG(al[ac], XmNbottomAttachment, XmATTACH_WIDGET); ac++;
+ Xt_SET_ARG(al[ac], XmNbottomOffset, 13); ac++;
+ Xt_SET_ARG(al[ac], XmNbottomWidget, separator); ac++;
+ Xt_SET_ARG(al[ac], XmNleftAttachment, XmATTACH_WIDGET); ac++;
+ Xt_SET_ARG(al[ac], XmNleftOffset, 13); ac++;
+ Xt_SET_ARG(al[ac], XmNleftWidget, icon); ac++;
+ Xt_SET_ARG(al[ac], XmNrightAttachment, XmATTACH_FORM); ac++;
+ Xt_SET_ARG(al[ac], XmNrightOffset, 13); ac++;
value = XmCreateScrolledList (form, "list", al, ac);
/* this is the easiest way I found to have the double click in the
@@ -1325,18 +1299,18 @@ make_dialog (char* UNUSED (name), Widget
/* else add nothing; it's a separator */
ac = 0;
- XtSetArg(al[ac], XmNalignment, XmALIGNMENT_BEGINNING); ac++;
- XtSetArg(al[ac], XmNtopAttachment, XmATTACH_FORM); ac++;
- XtSetArg(al[ac], XmNtopOffset, 13); ac++;
- XtSetArg(al[ac], XmNbottomAttachment, XmATTACH_WIDGET); ac++;
- XtSetArg(al[ac], XmNbottomOffset, 13); ac++;
- XtSetArg(al[ac], XmNbottomWidget,
- text_input_slot || radio_box || list ? value : separator); ac++;
- XtSetArg(al[ac], XmNleftAttachment, XmATTACH_WIDGET); ac++;
- XtSetArg(al[ac], XmNleftOffset, 13); ac++;
- XtSetArg(al[ac], XmNleftWidget, icon); ac++;
- XtSetArg(al[ac], XmNrightAttachment, XmATTACH_FORM); ac++;
- XtSetArg(al[ac], XmNrightOffset, 13); ac++;
+ Xt_SET_ARG(al[ac], XmNalignment, XmALIGNMENT_BEGINNING); ac++;
+ Xt_SET_ARG(al[ac], XmNtopAttachment, XmATTACH_FORM); ac++;
+ Xt_SET_ARG(al[ac], XmNtopOffset, 13); ac++;
+ Xt_SET_ARG(al[ac], XmNbottomAttachment, XmATTACH_WIDGET); ac++;
+ Xt_SET_ARG(al[ac], XmNbottomOffset, 13); ac++;
+ Xt_SET_ARG(al[ac], XmNbottomWidget,
+ text_input_slot || radio_box || list ? value : separator); ac++;
+ Xt_SET_ARG(al[ac], XmNleftAttachment, XmATTACH_WIDGET); ac++;
+ Xt_SET_ARG(al[ac], XmNleftOffset, 13); ac++;
+ Xt_SET_ARG(al[ac], XmNleftWidget, icon); ac++;
+ Xt_SET_ARG(al[ac], XmNrightAttachment, XmATTACH_FORM); ac++;
+ Xt_SET_ARG(al[ac], XmNrightOffset, 13); ac++;
message = XmCreateLabel (form, "message", al, ac);
DO_DND_KLUDGE (message);
@@ -1427,12 +1401,12 @@ recenter_widget (Widget widget)
Position y;
Arg al [2];
- XtSetArg (al [0], XtNwidth, &child_width);
- XtSetArg (al [1], XtNheight, &child_height);
+ Xt_SET_ARG (al [0], XtNwidth, &child_width);
+ Xt_SET_ARG (al [1], XtNheight, &child_height);
XtGetValues (widget, al, 2);
- XtSetArg (al [0], XtNwidth, &parent_width);
- XtSetArg (al [1], XtNheight, &parent_height);
+ Xt_SET_ARG (al [0], XtNwidth, &parent_width);
+ Xt_SET_ARG (al [1], XtNheight, &parent_height);
XtGetValues (parent, al, 2);
x = (Position) ((parent_width - child_width) / 2);
@@ -1450,8 +1424,8 @@ recenter_widget (Widget widget)
if (y < 0)
y = 0;
- XtSetArg (al [0], XtNx, x);
- XtSetArg (al [1], XtNy, y);
+ Xt_SET_ARG (al [0], XtNx, x);
+ Xt_SET_ARG (al [1], XtNy, y);
XtSetValues (widget, al, 2);
}
@@ -1484,8 +1458,8 @@ recycle_instance (destroyed_instance* in
if (separator)
{
Arg al [2];
- XtSetArg (al [0], XtNwidth, 5);
- XtSetArg (al [1], XtNheight, 5);
+ Xt_SET_ARG (al [0], XtNwidth, 5);
+ Xt_SET_ARG (al [1], XtNheight, 5);
XtSetValues (separator, al, 2);
}
@@ -1581,8 +1555,8 @@ make_menubar (widget_instance* instance)
Arg al[10];
int ac = 0;
- XtSetArg(al[ac], XmNmarginHeight, 0); ac++;
- XtSetArg(al[ac], XmNshadowThickness, 3); ac++;
+ Xt_SET_ARG(al[ac], XmNmarginHeight, 0); ac++;
+ Xt_SET_ARG(al[ac], XmNshadowThickness, 3); ac++;
return XmCreateMenuBar (instance->parent, instance->info->name, al, ac);
}
@@ -1622,21 +1596,22 @@ make_scrollbar (widget_instance *instanc
callbacks[0].closure = (XtPointer) instance;
- XtSetArg (al[ac], XmNminimum, 1); ac++;
- XtSetArg (al[ac], XmNmaximum, INT_MAX); ac++;
- XtSetArg (al[ac], XmNincrement, 1); ac++;
- XtSetArg (al[ac], XmNpageIncrement, 1); ac++;
- XtSetArg (al[ac], XmNborderWidth, 0); ac++;
- XtSetArg (al[ac], XmNorientation, vertical ? XmVERTICAL : XmHORIZONTAL); ac++;
-
- XtSetArg (al[ac], XmNdecrementCallback, callbacks); ac++;
- XtSetArg (al[ac], XmNdragCallback, callbacks); ac++;
- XtSetArg (al[ac], XmNincrementCallback, callbacks); ac++;
- XtSetArg (al[ac], XmNpageDecrementCallback, callbacks); ac++;
- XtSetArg (al[ac], XmNpageIncrementCallback, callbacks); ac++;
- XtSetArg (al[ac], XmNtoBottomCallback, callbacks); ac++;
- XtSetArg (al[ac], XmNtoTopCallback, callbacks); ac++;
- XtSetArg (al[ac], XmNvalueChangedCallback, callbacks); ac++;
+ Xt_SET_ARG (al[ac], XmNminimum, 1); ac++;
+ Xt_SET_ARG (al[ac], XmNmaximum, INT_MAX); ac++;
+ Xt_SET_ARG (al[ac], XmNincrement, 1); ac++;
+ Xt_SET_ARG (al[ac], XmNpageIncrement, 1); ac++;
+ Xt_SET_ARG (al[ac], XmNborderWidth, 0); ac++;
+ Xt_SET_ARG (al[ac], XmNorientation,
+ vertical ? XmVERTICAL : XmHORIZONTAL); ac++;
+
+ Xt_SET_ARG (al[ac], XmNdecrementCallback, callbacks); ac++;
+ Xt_SET_ARG (al[ac], XmNdragCallback, callbacks); ac++;
+ Xt_SET_ARG (al[ac], XmNincrementCallback, callbacks); ac++;
+ Xt_SET_ARG (al[ac], XmNpageDecrementCallback, callbacks); ac++;
+ Xt_SET_ARG (al[ac], XmNpageIncrementCallback, callbacks); ac++;
+ Xt_SET_ARG (al[ac], XmNtoBottomCallback, callbacks); ac++;
+ Xt_SET_ARG (al[ac], XmNtoTopCallback, callbacks); ac++;
+ Xt_SET_ARG (al[ac], XmNvalueChangedCallback, callbacks); ac++;
return XmCreateScrollBar (instance->parent, instance->info->name, al, ac);
}
@@ -1665,14 +1640,14 @@ xm_create_button (widget_instance *insta
Widget button = 0;
widget_value* val = instance->info->val;
- XtSetArg (al [ac], XmNsensitive, val->enabled); ac++;
- XtSetArg (al [ac], XmNalignment, XmALIGNMENT_BEGINNING); ac++;
- XtSetArg (al [ac], XmNuserData, val->call_data); ac++;
- XtSetArg (al [ac], XmNmappedWhenManaged, FALSE); ac++;
+ Xt_SET_ARG (al [ac], XmNsensitive, val->enabled); ac++;
+ Xt_SET_ARG (al [ac], XmNalignment, XmALIGNMENT_BEGINNING); ac++;
+ Xt_SET_ARG (al [ac], XmNuserData, val->call_data); ac++;
+ Xt_SET_ARG (al [ac], XmNmappedWhenManaged, FALSE); ac++;
/* The highlight doesn't appear to be dynamically set which makes it
look ugly. I think this may be a LessTif bug but for now we just
get rid of it. */
- XtSetArg (al [ac], XmNhighlightThickness, (Dimension)0);ac++;
+ Xt_SET_ARG (al [ac], XmNhighlightThickness, (Dimension)0); ac++;
/* add any args the user supplied for creation time */
lw_add_value_args_to_args (val, al, &ac);
@@ -1682,11 +1657,11 @@ xm_create_button (widget_instance *insta
else if (val->type == TOGGLE_TYPE || val->type == RADIO_TYPE)
{
- XtSetArg (al [ac], XmNset, val->selected); ac++;
- XtSetArg (al [ac], XmNindicatorType,
+ Xt_SET_ARG (al [ac], XmNset, val->selected); ac++;
+ Xt_SET_ARG (al [ac], XmNindicatorType,
(val->type == TOGGLE_TYPE ?
- XmN_OF_MANY : XmONE_OF_MANY)); ac++;
- XtSetArg (al [ac], XmNvisibleWhenOff, True); ac++;
+ XmN_OF_MANY : XmONE_OF_MANY)); ac++;
+ Xt_SET_ARG (al [ac], XmNvisibleWhenOff, True); ac++;
button = XmCreateToggleButton (instance->parent, val->name, al, ac);
XtRemoveAllCallbacks (button, XmNvalueChangedCallback);
XtAddCallback (button, XmNvalueChangedCallback, xm_generic_callback,
@@ -1715,30 +1690,30 @@ xm_create_progress (widget_instance *ins
widget_value* val = instance->info->val;
if (!val->call_data)
{
- XtSetArg (al [ac], XmNeditable, False); ac++;
+ Xt_SET_ARG (al [ac], XmNeditable, False); ac++;
}
else
{
- XtSetArg (al [ac], XmNeditable, val->enabled); ac++;
- }
- XtSetArg (al [ac], XmNalignment, XmALIGNMENT_BEGINNING); ac++;
- XtSetArg (al [ac], XmNuserData, val->call_data); ac++;
- XtSetArg (al [ac], XmNmappedWhenManaged, FALSE); ac++;
- XtSetArg (al [ac], XmNorientation, XmHORIZONTAL); ac++;
+ Xt_SET_ARG (al [ac], XmNeditable, val->enabled); ac++;
+ }
+ Xt_SET_ARG (al [ac], XmNalignment, XmALIGNMENT_BEGINNING); ac++;
+ Xt_SET_ARG (al [ac], XmNuserData, val->call_data); ac++;
+ Xt_SET_ARG (al [ac], XmNmappedWhenManaged, FALSE); ac++;
+ Xt_SET_ARG (al [ac], XmNorientation, XmHORIZONTAL); ac++;
/* The highlight doesn't appear to be dynamically set which makes it
look ugly. I think this may be a LessTif bug but for now we just
get rid of it. */
- XtSetArg (al [ac], XmNhighlightThickness, (Dimension)0);ac++;
+ Xt_SET_ARG (al [ac], XmNhighlightThickness, (Dimension)0); ac++;
height = (Dimension)lw_get_value_arg (val, XtNheight);
width = (Dimension)lw_get_value_arg (val, XtNwidth);
if (height > 0)
{
- XtSetArg (al [ac], XmNscaleHeight, height); ac++;
+ Xt_SET_ARG (al [ac], XmNscaleHeight, height); ac++;
}
if (width > 0)
{
- XtSetArg (al [ac], XmNscaleWidth, width); ac++;
+ Xt_SET_ARG (al [ac], XmNscaleWidth, width); ac++;
}
/* add any args the user supplied for creation time */
@@ -1762,14 +1737,14 @@ xm_create_text_field (widget_instance *i
Widget text = 0;
widget_value* val = instance->info->val;
- XtSetArg (al [ac], XmNsensitive, val->enabled); ac++;
- XtSetArg (al [ac], XmNalignment, XmALIGNMENT_BEGINNING); ac++;
- XtSetArg (al [ac], XmNuserData, val->call_data); ac++;
- XtSetArg (al [ac], XmNmappedWhenManaged, FALSE); ac++;
+ Xt_SET_ARG (al [ac], XmNsensitive, val->enabled); ac++;
+ Xt_SET_ARG (al [ac], XmNalignment, XmALIGNMENT_BEGINNING); ac++;
+ Xt_SET_ARG (al [ac], XmNuserData, val->call_data); ac++;
+ Xt_SET_ARG (al [ac], XmNmappedWhenManaged, FALSE); ac++;
/* The highlight doesn't appear to be dynamically set which makes it
look ugly. I think this may be a LessTif bug but for now we just
get rid of it. */
- XtSetArg (al [ac], XmNhighlightThickness, (Dimension)0);ac++;
+ Xt_SET_ARG (al [ac], XmNhighlightThickness, (Dimension)0); ac++;
/* add any args the user supplied for creation time */
lw_add_value_args_to_args (val, al, &ac);
@@ -1797,13 +1772,13 @@ xm_create_label (Widget parent, widget_v
int ac = 0;
Widget label = 0;
- XtSetArg (al [ac], XmNsensitive, val->enabled); ac++;
- XtSetArg (al [ac], XmNalignment, XmALIGNMENT_BEGINNING); ac++;
- XtSetArg (al [ac], XmNmappedWhenManaged, FALSE); ac++;
+ Xt_SET_ARG (al [ac], XmNsensitive, val->enabled); ac++;
+ Xt_SET_ARG (al [ac], XmNalignment, XmALIGNMENT_BEGINNING); ac++;
+ Xt_SET_ARG (al [ac], XmNmappedWhenManaged, FALSE); ac++;
/* The highlight doesn't appear to be dynamically set which makes it
look ugly. I think this may be a LessTif bug but for now we just
get rid of it. */
- XtSetArg (al [ac], XmNhighlightThickness, (Dimension)0);ac++;
+ Xt_SET_ARG (al [ac], XmNhighlightThickness, (Dimension)0); ac++;
/* add any args the user supplied for creation time */
lw_add_value_args_to_args (val, al, &ac);
@@ -1829,14 +1804,14 @@ xm_create_combo_box (widget_instance *in
Widget combo = 0;
widget_value* val = instance->info->val;
- XtSetArg (al [ac], XmNsensitive, val->enabled); ac++;
- XtSetArg (al [ac], XmNalignment, XmALIGNMENT_BEGINNING); ac++;
- XtSetArg (al [ac], XmNuserData, val->call_data); ac++;
- XtSetArg (al [ac], XmNmappedWhenManaged, FALSE); ac++;
+ Xt_SET_ARG (al [ac], XmNsensitive, val->enabled); ac++;
+ Xt_SET_ARG (al [ac], XmNalignment, XmALIGNMENT_BEGINNING); ac++;
+ Xt_SET_ARG (al [ac], XmNuserData, val->call_data); ac++;
+ Xt_SET_ARG (al [ac], XmNmappedWhenManaged, FALSE); ac++;
/* The highlight doesn't appear to be dynamically set which makes it
look ugly. I think this may be a LessTif bug but for now we just
get rid of it. */
- XtSetArg (al [ac], XmNhighlightThickness, (Dimension)0);ac++;
+ Xt_SET_ARG (al [ac], XmNhighlightThickness, (Dimension)0); ac++;
/* add any args the user supplied for creation time */
lw_add_value_args_to_args (val, al, &ac);
@@ -1944,7 +1919,7 @@ xm_popup_menu (Widget widget, XEvent *ev
if (trans)
{
Arg al [1];
- XtSetArg (al [0], XmNmenuPost, trans);
+ Xt_SET_ARG (al [0], XmNmenuPost, trans);
XtSetValues (widget, al, 1);
}
XmMenuPosition (widget, (XButtonPressedEvent *) event);
@@ -1963,12 +1938,12 @@ set_min_dialog_size (Widget w)
short height;
Arg al [2];
- XtSetArg (al [0], XmNwidth, &width);
- XtSetArg (al [1], XmNheight, &height);
+ Xt_SET_ARG (al [0], XmNwidth, &width);
+ Xt_SET_ARG (al [1], XmNheight, &height);
XtGetValues (w, al, 2);
- XtSetArg (al [0], XmNminWidth, width);
- XtSetArg (al [1], XmNminHeight, height);
+ Xt_SET_ARG (al [0], XmNminWidth, width);
+ Xt_SET_ARG (al [1], XmNminHeight, height);
XtSetValues (w, al, 2);
}
@@ -2014,7 +1989,6 @@ do_call (Widget widget, XtPointer closur
widget_instance* instance = (widget_instance*)closure;
Widget instance_widget;
LWLIB_ID id;
- Arg al [1];
if (!instance)
return;
@@ -2027,8 +2001,7 @@ do_call (Widget widget, XtPointer closur
id = instance->info->id;
user_data = NULL;
- XtSetArg(al [0], XmNuserData, &user_data);
- XtGetValues (widget, al, 1);
+ Xt_GET_VALUE (widget, XmNuserData, &user_data);
switch (type)
{
case pre_activate:
@@ -2080,13 +2053,9 @@ xm_generic_callback (Widget widget, XtPo
|| XtClass (widget) == xmToggleButtonGadgetClass)
{
Boolean check;
- Arg al [1];
-
- XtSetArg (al [0], XmNset, &check);
- XtGetValues (widget, al, 1);
-
- XtSetArg (al [0], XmNset, !check);
- XtSetValues (widget, al, 1);
+
+ Xt_GET_VALUE (widget, XmNset, &check);
+ Xt_SET_VALUE (widget, XmNset, !check);
}
#endif
lw_internal_update_other_instances (widget, closure, call_data);
diff -r 03ba50f7ecd7fb0dee997f30f1f1b7af746c7493 -r 726060ee587c536ac95384a055029092ea091231 lwlib/lwlib.c
--- a/lwlib/lwlib.c Wed Oct 29 04:02:05 2008 +0900
+++ b/lwlib/lwlib.c Wed Oct 29 04:06:33 2008 +0900
@@ -1385,7 +1385,7 @@ void lw_add_value_args_to_args (widget_v
}
}
-XtArgVal lw_get_value_arg (widget_value* wv, String name)
+XtArgVal lw_get_value_arg (widget_value* wv, const String name)
{
int i;
if (wv->args)
diff -r 03ba50f7ecd7fb0dee997f30f1f1b7af746c7493 -r 726060ee587c536ac95384a055029092ea091231 lwlib/lwlib.h
--- a/lwlib/lwlib.h Wed Oct 29 04:02:05 2008 +0900
+++ b/lwlib/lwlib.h Wed Oct 29 04:06:33 2008 +0900
@@ -2,6 +2,7 @@
#define INCLUDED_lwlib_h_
#include <X11/Intrinsic.h>
+#include "xt-wrappers.h"
#if defined (LWLIB_MENUBARS_LUCID) || defined (LWLIB_MENUBARS_MOTIF) || defined (LWLIB_MENUBARS_ATHENA)
#define NEED_MENUBARS
diff -r 03ba50f7ecd7fb0dee997f30f1f1b7af746c7493 -r 726060ee587c536ac95384a055029092ea091231 lwlib/xlwcheckbox.c
--- a/lwlib/xlwcheckbox.c Wed Oct 29 04:02:05 2008 +0900
+++ b/lwlib/xlwcheckbox.c Wed Oct 29 04:06:33 2008 +0900
@@ -40,6 +40,7 @@ Boston, MA 02111-1307, USA. */
#include <X11/StringDefs.h>
#include ATHENA_XawInit_h_
#include "../src/xmu.h"
+#include "xt-wrappers.h"
#include "xlwcheckboxP.h"
@@ -89,10 +90,12 @@ static char defaultTranslations[] =
-#define offset(field) XtOffsetOf(CheckboxRec, field)
+#define offset(field) XtOffsetOf(CheckboxRec, checkbox.field)
+#define res(name,_class,intrepr,type,member,extrepr,value) \
+ Xt_RESOURCE (name, _class, intrepr, type, offset(member), extrepr, value)
static XtResource resources[] = {
- {XtNtristate, XtCTristate, XtRBoolean, sizeof(Boolean),
- offset(checkbox.tristate), XtRImmediate, (XtPointer)FALSE},
+ res (XtNtristate, XtCTristate, XtRBoolean, Boolean, tristate,
+ XtRImmediate, FALSE),
} ;
#undef offset
@@ -127,7 +130,7 @@ CheckboxClassRec checkboxClassRec = {
CheckboxClassRec checkboxClassRec = {
{
(WidgetClass) SuperClass, /* superclass */
- "Checkbox", /* class_name */
+ (String) "Checkbox", /* class_name */
sizeof(CheckboxRec), /* size */
CheckboxClassInit, /* class_initialize */
NULL, /* class_part_initialize */
diff -r 03ba50f7ecd7fb0dee997f30f1f1b7af746c7493 -r 726060ee587c536ac95384a055029092ea091231 lwlib/xlwgauge.c
--- a/lwlib/xlwgauge.c Wed Oct 29 04:02:05 2008 +0900
+++ b/lwlib/xlwgauge.c Wed Oct 29 04:06:33 2008 +0900
@@ -53,6 +53,7 @@ Boston, MA 02111-1307, USA. */
#include <X11/Xatom.h>
#include <X11/StringDefs.h>
#include ATHENA_XawInit_h_
+#include "xt-wrappers.h"
#include "xlwgaugeP.h"
#include "../src/xmu.h"
#ifdef HAVE_XMU
@@ -77,33 +78,29 @@ static char defaultTranslations[] =
-#define offset(field) XtOffsetOf(GaugeRec, field)
+#define offset(field) XtOffsetOf(GaugeRec, gauge.field)
+#define res(name,_class,intrepr,type,member,extrepr,value) \
+ Xt_RESOURCE (name, _class, intrepr, type, offset(member), extrepr, value)
static XtResource resources[] = {
- {XtNvalue, XtCValue, XtRInt, sizeof(int),
- offset(gauge.value), XtRImmediate, (XtPointer)0},
- {XtNminValue, XtCMinValue, XtRInt, sizeof(int),
- offset(gauge.v0), XtRImmediate, (XtPointer)0},
- {XtNmaxValue, XtCMaxValue, XtRInt, sizeof(int),
- offset(gauge.v1), XtRImmediate, (XtPointer)100},
- {XtNntics, XtCNTics, XtRInt, sizeof(int),
- offset(gauge.ntics), XtRImmediate, (XtPointer) 0},
- {XtNnlabels, XtCNLabels, XtRInt, sizeof(int),
- offset(gauge.nlabels), XtRImmediate, (XtPointer) 0},
- {XtNlabels, XtCLabels, XtRStringArray, sizeof(String *),
- offset(gauge.labels), XtRStringArray, NULL},
- {XtNautoScaleUp, XtCAutoScaleUp, XtRBoolean, sizeof(Boolean),
- offset(gauge.autoScaleUp), XtRImmediate, FALSE},
- {XtNautoScaleDown, XtCAutoScaleDown, XtRBoolean, sizeof(Boolean),
- offset(gauge.autoScaleDown), XtRImmediate, FALSE},
- {XtNorientation, XtCOrientation, XtROrientation, sizeof(XtOrientation),
- offset(gauge.orientation), XtRImmediate, (XtPointer)XtorientHorizontal},
- {XtNupdate, XtCInterval, XtRInt, sizeof(int),
- offset(gauge.update), XtRImmediate, (XtPointer)0},
- {XtNgetValue, XtCCallback, XtRCallback, sizeof(XtPointer),
- offset(gauge.getValue), XtRImmediate, (XtPointer)NULL},
+ res (XtNvalue, XtCValue, XtRInt, int, value, XtRImmediate, 0),
+ res (XtNminValue, XtCMinValue, XtRInt, int, v0, XtRImmediate, 0),
+ res (XtNmaxValue, XtCMaxValue, XtRInt, int, v1, XtRImmediate, 100),
+ res (XtNntics, XtCNTics, XtRInt, int, ntics, XtRImmediate, 0),
+ res (XtNnlabels, XtCNLabels, XtRInt, int, nlabels, XtRImmediate, 0),
+ res (XtNlabels, XtCLabels, XtRStringArray, String *, labels,
+ XtRStringArray, NULL),
+ res (XtNautoScaleUp, XtCAutoScaleUp, XtRBoolean, Boolean, autoScaleUp,
+ XtRImmediate, FALSE),
+ res (XtNautoScaleDown, XtCAutoScaleDown, XtRBoolean, Boolean,
+ autoScaleDown, XtRImmediate, FALSE),
+ res (XtNorientation, XtCOrientation, XtROrientation, XtOrientation,
+ orientation, XtRImmediate, XtorientHorizontal),
+ res (XtNupdate, XtCInterval, XtRInt, int, update, XtRImmediate, 0),
+ res (XtNgetValue, XtCCallback, XtRCallback, XtPointer, getValue,
+ XtRImmediate, NULL),
};
#undef offset
-
+#undef res
/* member functions */
@@ -146,8 +143,8 @@ static GC Get_GC (GaugeWidget, Pixel);
static XtActionsRec actionsList[] =
{
- {"select", GaugeSelect},
- {"paste", GaugePaste},
+ { (String) "select", GaugeSelect },
+ { (String) "paste", GaugePaste },
} ;
@@ -162,7 +159,7 @@ GaugeClassRec gaugeClassRec = {
{
/* core_class fields */
/* superclass */ (WidgetClass) &labelClassRec,
- /* class_name */ "Gauge",
+ /* class_name */ (String) "Gauge",
/* widget_size */ sizeof(GaugeRec),
/* class_initialize */ GaugeClassInit,
/* class_part_initialize */ NULL,
diff -r 03ba50f7ecd7fb0dee997f30f1f1b7af746c7493 -r 726060ee587c536ac95384a055029092ea091231 lwlib/xlwmenu.c
--- a/lwlib/xlwmenu.c Wed Oct 29 04:02:05 2008 +0900
+++ b/lwlib/xlwmenu.c Wed Oct 29 04:06:33 2008 +0900
@@ -70,100 +70,112 @@ xlwMenuTranslations [] =
extern Widget lw_menubar_widget;
-#define offset(field) XtOffset(XlwMenuWidget, field)
static XtResource
xlwMenuResources[] =
{
+/* The offset macro is a standard trick. The remaining macros are an
+ experiment to compress redundancies in resource descriptions, and shut
+ up GCC 4.3 (the String casts, which keep G++ from complaining about
+ implicit conversions from const char *). */
+#define offset(field) XtOffset(XlwMenuWidget, menu.field)
+#define fontres(name,_class,repr,type,member,value) \
+ Xt_RESOURCE (name, _class, repr, type, offset(member), XtRString, value)
+#define mflres(name,cls,member,repr,value) \
+ Xt_RESOURCE (name, cls, XmRFontList, XmFontList, offset(member), repr, value)
+#define dimres(name,cls,repr,member,value) \
+ Xt_RESOURCE (name, cls, repr, Dimension, offset(member), XtRImmediate, value)
+#define boolres(nm,cls,member,val) \
+ Xt_RESOURCE (nm, cls, XtRBoolean, Boolean, offset(member), XtRImmediate, val)
+#define cbres(name,member,value) \
+ Xt_RESOURCE (name, XtCCallback, XtRCallback, XtPointer, offset(member), \
+ XtRCallback, value)
+#define pixres(name,_class,member,repr,value) \
+ Xt_RESOURCE (name, _class, XtRPixel, Pixel, offset(member), repr, value)
+#define fgpixres(name,_class,member) \
+ pixres (name, _class, member, XtRString, "XtDefaultForeground")
+#define nullpixres(name,_class,member) \
+ pixres (name, _class, member, XtRImmediate, -1)
+#define pmres(name,cls,member) \
+ Xt_RESOURCE (name, cls, XtRPixmap, Pixmap, offset(member), XtRImmediate, None)
+
#if defined(NEED_MOTIF) && !defined(USE_XFT_MENUBARS)
/* There are three font list resources, so that we can accept either of
the resources *fontList: or *font:, and so that we can tell the
difference between them being specified, and being defaulted to a
font from the XtRString specified here. */
- {XmNfontList, XmCFontList, XmRFontList, sizeof(XmFontList),
- offset(menu.font_list), XtRImmediate, (XtPointer)0},
- {XtNfont, XtCFont, XmRFontList, sizeof(XmFontList),
- offset(menu.font_list_2),XtRImmediate, (XtPointer)0},
- {XmNfontList, XmCFontList, XmRFontList, sizeof(XmFontList),
- offset(menu.fallback_font_list),
+ mflres (XmNfontList, XmCFontList, font_list, XtRImmediate, 0),
+ mflres (XtNfont, XtCFont, font_list_2, XtRImmediate, 0),
+ mflres (XmNfontList, XmCFontList, fallback_font_list,
/* We must use an iso8859-1 font here, or people without $LANG set lose.
It's fair to assume that those who do have $LANG set also have the
*fontList resource set, or at least know how to deal with this. */
- XtRString, (XtPointer) "-*-helvetica-bold-r-*-*-*-120-*-*-*-*-iso8859-1"},
-#else
- {XtNfont, XtCFont, XtRFontStruct, sizeof(XFontStruct *),
- offset(menu.font), XtRString, (XtPointer) "XtDefaultFont"},
+ XtRString, (XtPointer) "-*-helvetica-bold-r-*-*-*-120-*-*-*-*-iso8859-1"),
+#else
+ fontres (XtNfont, XtCFont, XtRFontStruct, XFontStruct *, font,
+ "XtDefaultFont"),
#ifdef USE_XFT_MENUBARS
- {XtNfcFontName, XtCFcFontName, XtRString, sizeof (String),
- offset(menu.fcFontName),
- XtRString, (XtPointer) NULL},
+ fontres (XtNfcFontName, XtCFcFontName, XtRString, String, fcFontName,
+ "sans-serif-12:bold"),
/* #### This needs to be fixed to give a proper type and converter for
XftFonts. See also xlwtabs.c. */
- {XtNxftFont, XtCXftFont, XtRString, sizeof(XtPointer),
- offset(menu.xftFontName), XtRString, (XtPointer) "Helvetica-12:bold" },
+ fontres (XtNxftFont, XtCXftFont, XtRString, XtPointer, xftFontName,
+ "Helvetica-12:bold"),
#endif
# ifdef USE_XFONTSET
/* #### Consider using the same method as for Motif; see the comment in
XlwMenuInitialize(). */
- {XtNfontSet, XtCFontSet, XtRFontSet, sizeof(XFontSet),
- offset(menu.font_set), XtRString, (XtPointer) "XtDefaultFontSet"},
+ fontres (XtNfontSet, XtCFontSet, XtRFontSet, XFontSet, font_set,
+ "XtDefaultFontSet"),
# endif
#endif
- {XtNforeground, XtCForeground, XtRPixel, sizeof(Pixel),
- offset(menu.foreground), XtRString, (XtPointer) "XtDefaultForeground"},
- {XtNbuttonForeground, XtCButtonForeground, XtRPixel, sizeof(Pixel),
- offset(menu.button_foreground), XtRString, (XtPointer) "XtDefaultForeground"},
- {XtNhighlightForeground, XtCHighlightForeground, XtRPixel, sizeof(Pixel),
- offset(menu.highlight_foreground), XtRString, (XtPointer) "XtDefaultForeground"},
- {XtNtitleForeground, XtCTitleForeground, XtRPixel, sizeof(Pixel),
- offset(menu.title_foreground), XtRString, (XtPointer) "XtDefaultForeground"},
- {XtNmargin, XtCMargin, XtRDimension, sizeof(Dimension),
- offset(menu.margin), XtRImmediate, (XtPointer)2},
- {XmNmarginWidth, XmCMarginWidth, XmRHorizontalDimension, sizeof(Dimension),
- offset(menu.horizontal_margin), XtRImmediate, (XtPointer)2},
- {XmNmarginHeight, XmCMarginHeight, XmRVerticalDimension, sizeof(Dimension),
- offset(menu.vertical_margin), XtRImmediate, (XtPointer)1},
- {XmNspacing, XmCSpacing, XmRHorizontalDimension, sizeof(Dimension),
- offset(menu.column_spacing), XtRImmediate, (XtPointer)4},
- {XmNindicatorSize, XmCIndicatorSize, XtRDimension, sizeof(Dimension),
- offset(menu.indicator_size), XtRImmediate, (XtPointer)0},
+ fgpixres (XtNforeground, XtCForeground, foreground),
+ fgpixres (XtNbuttonForeground, XtCButtonForeground, button_foreground),
+ fgpixres (XtNhighlightForeground, XtCHighlightForeground,
+ highlight_foreground),
+ fgpixres (XtNtitleForeground, XtCTitleForeground, title_foreground),
+ dimres (XtNmargin, XtCMargin, XtRDimension, margin, 2),
+ dimres (XmNmarginWidth, XmCMarginWidth, XmRHorizontalDimension,
+ horizontal_margin, 2),
+ dimres (XmNmarginHeight, XmCMarginHeight, XmRVerticalDimension,
+ vertical_margin, 1),
+ dimres (XmNspacing, XmCSpacing, XmRHorizontalDimension, column_spacing, 4),
+ dimres (XmNindicatorSize, XmCIndicatorSize, XtRDimension, indicator_size, 0),
#if 0
- {XmNshadowThickness, XmCShadowThickness, XmRHorizontalDimension,
- sizeof (Dimension), offset (menu.shadow_thickness),
- XtRImmediate, (XtPointer) 2},
-#else
- {XmNshadowThickness, XmCShadowThickness, XtRDimension,
- sizeof (Dimension), offset (menu.shadow_thickness),
- XtRImmediate, (XtPointer) 2},
-#endif
- {XmNselectColor, XmCSelectColor, XtRPixel, sizeof (Pixel),
- offset (menu.select_color), XtRImmediate, (XtPointer)-1},
- {XmNtopShadowColor, XmCTopShadowColor, XtRPixel, sizeof (Pixel),
- offset (menu.top_shadow_color), XtRImmediate, (XtPointer)-1},
- {XmNbottomShadowColor, XmCBottomShadowColor, XtRPixel, sizeof (Pixel),
- offset (menu.bottom_shadow_color), XtRImmediate, (XtPointer)-1},
- {XmNtopShadowPixmap, XmCTopShadowPixmap, XtRPixmap, sizeof (Pixmap),
- offset (menu.top_shadow_pixmap), XtRImmediate, (XtPointer)None},
- {XmNbottomShadowPixmap, XmCBottomShadowPixmap, XtRPixmap, sizeof (Pixmap),
- offset (menu.bottom_shadow_pixmap), XtRImmediate, (XtPointer)None},
-
- {XtNopen, XtCCallback, XtRCallback, sizeof(XtPointer),
- offset(menu.open), XtRCallback, (XtPointer)NULL},
- {XtNselect, XtCCallback, XtRCallback, sizeof(XtPointer),
- offset(menu.select), XtRCallback, (XtPointer)NULL},
- {XtNmenu, XtCMenu, XtRPointer, sizeof(XtPointer),
- offset(menu.contents), XtRImmediate, (XtPointer)NULL},
- {XtNcursor, XtCCursor, XtRCursor, sizeof(Cursor),
- offset(menu.cursor_shape), XtRString, (XtPointer) "right_ptr"},
- {XtNhorizontal, XtCHorizontal, XtRInt, sizeof(int),
- offset(menu.horizontal), XtRImmediate, (XtPointer)True},
- {XtNuseBackingStore, XtCUseBackingStore, XtRBoolean, sizeof (Boolean),
- offset (menu.use_backing_store), XtRImmediate, (XtPointer)False},
- {XtNbounceDown, XtCBounceDown, XtRBoolean, sizeof (Boolean),
- offset (menu.bounce_down), XtRImmediate, (XtPointer)True},
- {XtNresourceLabels, XtCResourceLabels, XtRBoolean, sizeof (Boolean),
- offset (menu.lookup_labels), XtRImmediate, (XtPointer)False},
+ dimres (XmNshadowThickness, XmCShadowThickness, XmRHorizontalDimension,
+ shadow_thickness, 2),
+#else
+ dimres (XmNshadowThickness, XmCShadowThickness, XtRDimension,
+ shadow_thickness, 2),
+#endif
+ nullpixres (XmNselectColor, XmCSelectColor, select_color),
+ nullpixres (XmNtopShadowColor, XmCTopShadowColor, top_shadow_color),
+ nullpixres (XmNbottomShadowColor, XmCBottomShadowColor, bottom_shadow_color),
+ pmres (XmNtopShadowPixmap, XmCTopShadowPixmap, top_shadow_pixmap),
+ pmres (XmNbottomShadowPixmap, XmCBottomShadowPixmap, bottom_shadow_pixmap),
+
+ cbres (XtNopen, open, NULL),
+ cbres (XtNselect, select, NULL),
+ Xt_RESOURCE (XtNmenu, XtCMenu, XtRPointer, XtPointer, offset(contents),
+ XtRImmediate, NULL),
+ Xt_RESOURCE (XtNcursor, XtCCursor, XtRCursor, Cursor, offset(cursor_shape),
+ XtRString, "right_ptr"),
+ Xt_RESOURCE (XtNhorizontal, XtCHorizontal, XtRInt, int, offset(horizontal),
+ XtRImmediate, True),
+ boolres (XtNuseBackingStore, XtCUseBackingStore, use_backing_store, False),
+ boolres (XtNbounceDown, XtCBounceDown, bounce_down, True),
+ boolres (XtNresourceLabels, XtCResourceLabels, lookup_labels, False),
+
+#undef offset
+#undef mflres
+#undef fontres
+#undef dimres
+#undef boolres
+#undef cbres
+#undef pixres
+#undef fgpixres
+#undef nullpixres
+#undef pmres
};
-#undef offset
static Boolean XlwMenuSetValues (Widget current, Widget request, Widget new_,
ArgList args, Cardinal *num_args);
@@ -186,9 +198,9 @@ static XtActionsRec
static XtActionsRec
xlwMenuActionsList [] =
{
- {"start", Start},
- {"drag", Drag},
- {"select", Select},
+ { (String) "start", Start},
+ { (String) "drag", Drag},
+ { (String) "select", Select},
};
#define SuperClass ((CoreWidgetClass)&coreClassRec)
@@ -197,7 +209,7 @@ XlwMenuClassRec xlwMenuClassRec =
{
{ /* CoreClass fields initialization */
(WidgetClass) SuperClass, /* superclass */
- "XlwMenu", /* class_name */
+ (String) "XlwMenu", /* class_name */
sizeof(XlwMenuRec), /* size */
XlwMenuClassInitialize, /* class_initialize */
NULL, /* class_part_initialize */
@@ -495,7 +507,7 @@ static XtResource
static XtResource
nameResource[] =
{
- { "labelString", "LabelString", XtRString, sizeof(String),
+ { (String) "labelString", (String) "LabelString", XtRString, sizeof(String),
0, XtRImmediate, 0 }
};
diff -r 03ba50f7ecd7fb0dee997f30f1f1b7af746c7493 -r 726060ee587c536ac95384a055029092ea091231 lwlib/xlwradio.c
--- a/lwlib/xlwradio.c Wed Oct 29 04:02:05 2008 +0900
+++ b/lwlib/xlwradio.c Wed Oct 29 04:06:33 2008 +0900
@@ -55,6 +55,7 @@ Boston, MA 02111-1307, USA. */
#include <X11/StringDefs.h>
#include ATHENA_XawInit_h_
#include "../src/xmu.h"
+#include "xt-wrappers.h"
#include "xlwradioP.h"
#define BOX_SIZE 13
@@ -116,8 +117,8 @@ static void RadioSize (RadioWidget, Dime
static XtActionsRec actionsList[] =
{
- {"highlight", RadioHighlight},
- {"unhighlight", RadioUnhighlight},
+ { (String) "highlight", RadioHighlight },
+ { (String) "unhighlight", RadioUnhighlight },
};
#define SuperClass ((ToggleWidgetClass)&toggleClassRec)
@@ -125,7 +126,7 @@ RadioClassRec radioClassRec = {
RadioClassRec radioClassRec = {
{
(WidgetClass) SuperClass, /* superclass */
- "Radio", /* class_name */
+ (String) "Radio", /* class_name */
sizeof(RadioRec), /* size */
RadioClassInit, /* class_initialize */
RadioClassPartInit, /* class_part_initialize */
diff -r 03ba50f7ecd7fb0dee997f30f1f1b7af746c7493 -r 726060ee587c536ac95384a055029092ea091231 lwlib/xlwscrollbar.c
--- a/lwlib/xlwscrollbar.c Wed Oct 29 04:02:05 2008 +0900
+++ b/lwlib/xlwscrollbar.c Wed Oct 29 04:06:33 2008 +0900
@@ -79,6 +79,7 @@ Boston, MA 02111-1307, USA. */
#include <X11/bitmaps/gray>
#include "lwlib-colors.h"
+#include "xt-wrappers.h"
#include "xlwscrollbarP.h"
#include "xlwscrollbar.h"
@@ -113,90 +114,79 @@ typedef enum
} SliderStyle;
/*-------------------------- Resources ----------------------------------*/
+
+static XtResource resources[] = {
#define offset(field) XtOffset(XlwScrollBarWidget, field)
-
-static XtResource resources[] = {
- { XmNforeground, XmCForeground, XtRPixel, sizeof(Pixel),
- offset(sb.foreground), XtRImmediate, (XtPointer) XtDefaultForeground },
-
- { XmNtopShadowColor, XmCTopShadowColor, XtRPixel,
- sizeof(Pixel), offset(sb.topShadowColor), XtRImmediate, (XtPointer) ~0 },
- { XmNbottomShadowColor, XmCBottomShadowColor, XtRPixel,
- sizeof(Pixel), offset(sb.bottomShadowColor), XtRImmediate,
- (XtPointer)~0 },
-
- { XmNtopShadowPixmap, XmCTopShadowPixmap, XtRPixmap,
- sizeof (Pixmap), offset(sb.topShadowPixmap), XtRImmediate,
- (XtPointer)None},
- { XmNbottomShadowPixmap, XmCBottomShadowPixmap,
- XtRPixmap, sizeof (Pixmap), offset(sb.bottomShadowPixmap),
- XtRImmediate, (XtPointer)None},
-
- { XmNtroughColor, XmCTroughColor, XtRPixel, sizeof(Pixel),
- offset(sb.troughColor), XtRImmediate, (XtPointer)~0 },
-
- { XmNshadowThickness, XmCShadowThickness, XtRInt,
- sizeof(int), offset(sb.shadowThickness), XtRImmediate, (XtPointer)2 },
-
- { XmNborderWidth, XmCBorderWidth, XtRDimension,
- sizeof(Dimension), offset(core.border_width), XtRImmediate,
- (XtPointer)0 },
-
- { XmNshowArrows, XmCShowArrows, XtRBoolean,
- sizeof(Boolean), offset(sb.showArrows), XtRImmediate, (XtPointer)True },
-
- { XmNinitialDelay, XmCInitialDelay, XtRInt, sizeof(int),
- offset(sb.initialDelay), XtRImmediate, (XtPointer) 250 },
- { XmNrepeatDelay, XmCRepeatDelay, XtRInt, sizeof(int),
- offset(sb.repeatDelay), XtRImmediate, (XtPointer) 50 },
-
- { XmNorientation, XmCOrientation, XtROrientation,
- sizeof(unsigned char), offset(sb.orientation), XtRImmediate,
- (XtPointer) XmVERTICAL },
-
- { XmNminimum, XmCMinimum, XtRInt, sizeof(int),
- offset(sb.minimum), XtRImmediate, (XtPointer) 0},
- { XmNmaximum, XmCMaximum, XtRInt, sizeof(int),
- offset(sb.maximum), XtRImmediate, (XtPointer) 100},
- { XmNvalue, XmCValue, XtRInt, sizeof(int),
- offset(sb.value), XtRImmediate, (XtPointer) 0},
- { XmNsliderSize, XmCSliderSize, XtRInt, sizeof(int),
- offset(sb.sliderSize), XtRImmediate, (XtPointer) 10},
- { XmNincrement, XmCIncrement, XtRInt, sizeof(int),
- offset(sb.increment), XtRImmediate, (XtPointer) 1},
- { XmNpageIncrement, XmCPageIncrement, XtRInt, sizeof(int),
- offset(sb.pageIncrement), XtRImmediate, (XtPointer) 10},
-
- { XmNvalueChangedCallback, XmCValueChangedCallback,
- XtRCallback, sizeof(XtPointer), offset(sb.valueChangedCBL),
- XtRCallback, NULL},
- { XmNincrementCallback, XmCIncrementCallback,
- XtRCallback, sizeof(XtPointer), offset(sb.incrementCBL),
- XtRCallback, NULL},
- { XmNdecrementCallback, XmCDecrementCallback,
- XtRCallback, sizeof(XtPointer), offset(sb.decrementCBL),
- XtRCallback, NULL},
- { XmNpageIncrementCallback, XmCPageIncrementCallback,
- XtRCallback, sizeof(XtPointer), offset(sb.pageIncrementCBL),
- XtRCallback, NULL},
- { XmNpageDecrementCallback, XmCPageDecrementCallback,
- XtRCallback, sizeof(XtPointer), offset(sb.pageDecrementCBL),
- XtRCallback, NULL},
- { XmNtoTopCallback, XmCToTopCallback, XtRCallback,
- sizeof(XtPointer), offset(sb.toTopCBL), XtRCallback, NULL},
- { XmNtoBottomCallback, XmCToBottomCallback, XtRCallback,
- sizeof(XtPointer), offset(sb.toBottomCBL), XtRCallback, NULL},
- { XmNdragCallback, XmCDragCallback, XtRCallback,
- sizeof(XtPointer), offset(sb.dragCBL), XtRCallback, NULL},
+#define res(name,_class,intrepr,type,member,extrepr,value) \
+ Xt_RESOURCE (name, _class, intrepr, type, offset(sb.member), extrepr, value)
+
+ res (XmNforeground, XmCForeground, XtRPixel, Pixel,
+ foreground, XtRImmediate, XtDefaultForeground),
+ res (XmNtopShadowColor, XmCTopShadowColor, XtRPixel,
+ Pixel, topShadowColor, XtRImmediate, ~0),
+ res (XmNbottomShadowColor, XmCBottomShadowColor, XtRPixel,
+ Pixel, bottomShadowColor, XtRImmediate, ~0),
+
+ res (XmNtopShadowPixmap, XmCTopShadowPixmap, XtRPixmap,
+ Pixmap, topShadowPixmap, XtRImmediate, None),
+ res (XmNbottomShadowPixmap, XmCBottomShadowPixmap,
+ XtRPixmap, Pixmap, bottomShadowPixmap, XtRImmediate, None),
+
+ res (XmNtroughColor, XmCTroughColor, XtRPixel, Pixel, troughColor,
+ XtRImmediate, ~0),
+
+ res (XmNshadowThickness, XmCShadowThickness, XtRInt, int,
+ shadowThickness, XtRImmediate, 2),
+
+ Xt_RESOURCE (XmNborderWidth, XmCBorderWidth, XtRDimension, Dimension,
+ offset(core.border_width), XtRImmediate, 0),
+
+ res (XmNshowArrows, XmCShowArrows, XtRBoolean, Boolean, showArrows,
+ XtRImmediate, True),
+
+ res (XmNinitialDelay, XmCInitialDelay, XtRInt, int, initialDelay,
+ XtRImmediate, 250),
+ res (XmNrepeatDelay, XmCRepeatDelay, XtRInt, int, repeatDelay,
+ XtRImmediate, 50),
+
+ res (XmNorientation, XmCOrientation, XtROrientation,
+ unsigned char, orientation, XtRImmediate, XmVERTICAL),
+
+ res (XmNminimum, XmCMinimum, XtRInt, int, minimum, XtRImmediate, 0),
+ res (XmNmaximum, XmCMaximum, XtRInt, int, maximum, XtRImmediate, 100),
+ res (XmNvalue, XmCValue, XtRInt, int, value, XtRImmediate, 0),
+ res (XmNsliderSize, XmCSliderSize, XtRInt, int, sliderSize, XtRImmediate, 10),
+ res (XmNincrement, XmCIncrement, XtRInt, int, increment, XtRImmediate, 1),
+ res (XmNpageIncrement, XmCPageIncrement, XtRInt, int,
+ pageIncrement, XtRImmediate, 10),
+
+ res (XmNvalueChangedCallback, XmCValueChangedCallback,
+ XtRCallback, XtPointer, valueChangedCBL, XtRCallback, NULL),
+ res (XmNincrementCallback, XmCIncrementCallback,
+ XtRCallback, XtPointer, incrementCBL, XtRCallback, NULL),
+ res (XmNdecrementCallback, XmCDecrementCallback,
+ XtRCallback, XtPointer, decrementCBL, XtRCallback, NULL),
+ res (XmNpageIncrementCallback, XmCPageIncrementCallback,
+ XtRCallback, XtPointer, pageIncrementCBL, XtRCallback, NULL),
+ res (XmNpageDecrementCallback, XmCPageDecrementCallback,
+ XtRCallback, XtPointer, pageDecrementCBL, XtRCallback, NULL),
+ res (XmNtoTopCallback, XmCToTopCallback, XtRCallback,
+ XtPointer, toTopCBL, XtRCallback, NULL),
+ res (XmNtoBottomCallback, XmCToBottomCallback, XtRCallback,
+ XtPointer, toBottomCBL, XtRCallback, NULL),
+ res (XmNdragCallback, XmCDragCallback, XtRCallback,
+ XtPointer, dragCBL, XtRCallback, NULL),
/* "knob" is obsolete; use "slider" instead. */
- { XmNsliderStyle, XmCSliderStyle, XtRString, sizeof(char *),
- offset(sb.sliderStyle), XtRImmediate, NULL},
- { XmNknobStyle, XmCKnobStyle, XtRString, sizeof(char *),
- offset(sb.knobStyle), XtRImmediate, NULL},
-
- { XmNarrowPosition, XmCArrowPosition, XtRString, sizeof(char *),
- offset(sb.arrowPosition), XtRImmediate, NULL},
+ res (XmNsliderStyle, XmCSliderStyle, XtRString, char *,
+ sliderStyle, XtRImmediate, NULL),
+ res (XmNknobStyle, XmCKnobStyle, XtRString, char *,
+ knobStyle, XtRImmediate, NULL),
+
+ res (XmNarrowPosition, XmCArrowPosition, XtRString, char *,
+ arrowPosition, XtRImmediate, NULL),
+#undef offset
+#undef res
};
/*-------------------------- Prototypes ---------------------------------*/
@@ -218,13 +208,13 @@ static void Realize(Widget widget, XtVal
/*-------------------------- Actions Table ------------------------------*/
static XtActionsRec actions[] =
{
- {"Select", Select},
- {"PageDownOrRight", PageDownOrRight},
- {"PageUpOrLeft", PageUpOrLeft},
- {"Drag", Drag},
- {"Release", Release},
- {"Jump", Jump},
- {"Abort", Abort},
+ { (String) "Select", Select},
+ { (String) "PageDownOrRight", PageDownOrRight},
+ { (String) "PageUpOrLeft", PageUpOrLeft},
+ { (String) "Drag", Drag},
+ { (String) "Release", Release},
+ { (String) "Jump", Jump},
+ { (String) "Abort", Abort},
};
/*--------------------- Default Translation Table -----------------------*/
@@ -243,7 +233,7 @@ XlwScrollBarClassRec xlwScrollBarClassRe
/* core_class fields */
{
/* superclass */ (WidgetClass) &coreClassRec,
- /* class_name */ "XlwScrollBar",
+ /* class_name */ (String) "XlwScrollBar",
/* widget_size */ sizeof(XlwScrollBarRec),
/* class_initialize */ NULL,
/* class_part_init */ NULL,
diff -r 03ba50f7ecd7fb0dee997f30f1f1b7af746c7493 -r 726060ee587c536ac95384a055029092ea091231 lwlib/xlwtabs.c
--- a/lwlib/xlwtabs.c Wed Oct 29 04:02:05 2008 +0900
+++ b/lwlib/xlwtabs.c Wed Oct 29 04:06:33 2008 +0900
@@ -142,64 +142,69 @@ static char accelTable[] = " #augment\n\
" ;
static XtAccelerators defaultAccelerators ; /* #### Never used */
+static XtResource resources[] = {
#define offset(field) XtOffsetOf(TabsRec, tabs.field)
-static XtResource resources[] = {
-
- {XtNselectInsensitive, XtCSelectInsensitive, XtRBoolean, sizeof(Boolean),
- offset(selectInsensitive), XtRImmediate, (XtPointer) True},
- {XtNfont, XtCFont, XtRFontStruct, sizeof(XFontStruct *),
- offset(font), XtRString, (XtPointer) XtDefaultFont},
+#define res(name,_class,intrepr,type,member,extrepr,value) \
+ Xt_RESOURCE (name, _class, intrepr, type, offset(member), extrepr, value)
+
+ res (XtNselectInsensitive, XtCSelectInsensitive, XtRBoolean, Boolean,
+ selectInsensitive, XtRImmediate, True),
+ res (XtNfont, XtCFont, XtRFontStruct, XFontStruct *,
+ font, XtRString, XtDefaultFont),
#ifdef USE_XFT_TABS
/* #### Maybe use "-*-helvetica-bold-r-*-*-*-120-*-*-*-*-iso8859-1" here?
or XtDefaultFont? */
- {XtNfcFontName, XtCFcFontName, XtRString, sizeof(String),
- offset(fcFontName), XtRString, (XtPointer) NULL },
+ res (XtNfcFontName, XtCFcFontName, XtRString, String,
+ fcFontName, XtRString, NULL),
/* #### This needs to be fixed to give a proper type and converter for
XftFonts. See also xlwmenu.c. */
- {XtNxftFont, XtCXftFont, XtRString, sizeof(String),
- offset(xftFontName), XtRString, (XtPointer) "Helvetica-12" },
-#endif
- {XtNinternalWidth, XtCWidth, XtRDimension, sizeof(Dimension),
- offset(internalWidth), XtRImmediate, (XtPointer)4 },
- {XtNinternalHeight, XtCHeight, XtRDimension, sizeof(Dimension),
- offset(internalHeight), XtRImmediate, (XtPointer)4 },
- {XtNborderWidth, XtCBorderWidth, XtRDimension, sizeof(Dimension),
- XtOffsetOf(RectObjRec,rectangle.border_width), XtRImmediate, (XtPointer)0},
- {XtNtopWidget, XtCTopWidget, XtRWidget, sizeof(Widget),
- offset(topWidget), XtRImmediate, NULL},
- {XtNcallback, XtCCallback, XtRCallback, sizeof(XtPointer),
- offset(callbacks), XtRCallback, NULL},
- {XtNpopdownCallback, XtCCallback, XtRCallback, sizeof(XtPointer),
- offset(popdownCallbacks), XtRCallback, NULL},
- {XtNbeNiceToColormap, XtCBeNiceToColormap, XtRBoolean, sizeof(Boolean),
- offset(be_nice_to_cmap), XtRImmediate, (XtPointer) True},
- {XtNtopShadowContrast, XtCTopShadowContrast, XtRInt, sizeof(int),
- offset(top_shadow_contrast), XtRImmediate, (XtPointer) 20},
- {XtNbottomShadowContrast, XtCBottomShadowContrast, XtRInt, sizeof(int),
- offset(bot_shadow_contrast), XtRImmediate, (XtPointer) 40},
- {XtNinsensitiveContrast, XtCInsensitiveContrast, XtRInt, sizeof(int),
- offset(insensitive_contrast), XtRImmediate, (XtPointer) 33},
- {XtNaccelerators, XtCAccelerators, XtRAcceleratorTable,sizeof(XtTranslations),
- XtOffsetOf(TabsRec,core.accelerators), XtRString, accelTable},
+ res (XtNxftFont, XtCXftFont, XtRString, String,
+ xftFontName, XtRString, "Helvetica-12"),
+#endif
+ res (XtNinternalWidth, XtCWidth, XtRDimension, Dimension,
+ internalWidth, XtRImmediate, 4),
+ res (XtNinternalHeight, XtCHeight, XtRDimension, Dimension,
+ internalHeight, XtRImmediate, 4),
+ Xt_RESOURCE (XtNborderWidth, XtCBorderWidth, XtRDimension, Dimension,
+ XtOffsetOf(RectObjRec,rectangle.border_width), XtRImmediate, 0),
+ res (XtNtopWidget, XtCTopWidget, XtRWidget, Widget,
+ topWidget, XtRImmediate, NULL),
+ res (XtNcallback, XtCCallback, XtRCallback, XtPointer,
+ callbacks, XtRCallback, NULL),
+ res (XtNpopdownCallback, XtCCallback, XtRCallback, XtPointer,
+ popdownCallbacks, XtRCallback, NULL),
+ res (XtNbeNiceToColormap, XtCBeNiceToColormap, XtRBoolean, Boolean,
+ be_nice_to_cmap, XtRImmediate, True),
+ res (XtNtopShadowContrast, XtCTopShadowContrast, XtRInt, int,
+ top_shadow_contrast, XtRImmediate, 20),
+ res (XtNbottomShadowContrast, XtCBottomShadowContrast, XtRInt, int,
+ bot_shadow_contrast, XtRImmediate, 40),
+ res (XtNinsensitiveContrast, XtCInsensitiveContrast, XtRInt, int,
+ insensitive_contrast, XtRImmediate, 33),
+ Xt_RESOURCE (XtNaccelerators, XtCAccelerators, XtRAcceleratorTable,
+ XtTranslations, XtOffsetOf(TabsRec,core.accelerators),
+ XtRString, accelTable),
+#undef offset
+#undef res
};
+
+
+ /* constraint resources */
+
+static XtResource tabsConstraintResources[] = {
+#define offset(field) XtOffsetOf(TabsConstraintsRec, tabs.field)
+#define res(name,_class,intrepr,type,member,extrepr,value) \
+ Xt_RESOURCE (name, _class, intrepr, type, offset(member), extrepr, value)
+ res (XtNtabLabel, XtCLabel, XtRString, String, label, XtRString, NULL),
+ res (XtNtabLeftBitmap, XtCLeftBitmap, XtRBitmap, Pixmap, left_bitmap,
+ XtRImmediate, None),
+ res (XtNtabForeground, XtCForeground, XtRPixel, Pixel, foreground,
+ XtRString, XtDefaultForeground),
+ res (XtNresizable, XtCResizable, XtRBoolean, Boolean, resizable,
+ XtRImmediate, True),
#undef offset
-
-
-
- /* constraint resources */
-
-#define offset(field) XtOffsetOf(TabsConstraintsRec, tabs.field)
-static XtResource tabsConstraintResources[] = {
- {XtNtabLabel, XtCLabel, XtRString, sizeof(String),
- offset(label), XtRString, NULL},
- {XtNtabLeftBitmap, XtCLeftBitmap, XtRBitmap, sizeof(Pixmap),
- offset(left_bitmap), XtRImmediate, None},
- {XtNtabForeground, XtCForeground, XtRPixel, sizeof(Pixel),
- offset(foreground), XtRString, (XtPointer) XtDefaultForeground},
- {XtNresizable, XtCResizable, XtRBoolean, sizeof(Boolean),
- offset(resizable), XtRImmediate, (XtPointer) True},
+#undef res
} ;
-#undef offset
@@ -318,10 +323,10 @@ static void TabsAllocGreyGC( TabsWidget
static XtActionsRec actionsList[] =
{
- {"select", TabsSelect},
- {"page", TabsPage},
- {"highlight", TabsHighlight},
- {"unhighlight", TabsUnhighlight},
+ { (String) "select", TabsSelect },
+ { (String) "page", TabsPage },
+ { (String) "highlight", TabsHighlight },
+ { (String) "unhighlight", TabsUnhighlight },
} ;
@@ -341,7 +346,7 @@ TabsClassRec tabsClassRec = {
{
/* core_class fields */
/* superclass */ (WidgetClass) SuperClass,
- /* class_name */ "Tabs",
+ /* class_name */ (String) "Tabs",
/* widget_size */ sizeof(TabsRec),
/* class_initialize */ TabsClassInit,
/* class_part_init */ NULL, /* TODO? */
diff -r 03ba50f7ecd7fb0dee997f30f1f1b7af746c7493 -r 726060ee587c536ac95384a055029092ea091231 src/EmacsFrame.c
--- a/src/EmacsFrame.c Wed Oct 29 04:02:05 2008 +0900
+++ b/src/EmacsFrame.c Wed Oct 29 04:06:33 2008 +0900
@@ -43,6 +43,7 @@ Boston, MA 02111-1307, USA. */
#include "EmacsFrameP.h"
#include "EmacsManager.h" /* for EmacsManagerChangeSize */
#include "xmu.h"
+#include "../lwlib/xt-wrappers.h"
static void EmacsFrameClassInitialize (void);
static void EmacsFrameInitialize (Widget, Widget, ArgList, Cardinal *);
@@ -60,117 +61,83 @@ emacs_Xt_mapping_action (Widget w, XEven
#define XtOffset(p_type,field) \
((Cardinal) (((char *) (&(((p_type)0)->field))) - ((char *)0)))
#define offset(field) XtOffset (EmacsFrame, emacs_frame.field)
-
+#define res(name,_class,intrepr,type,member,extrepr,value) \
+ Xt_RESOURCE (name, _class, intrepr, type, offset(member), extrepr, value)
static XtResource resources[] = {
- { XtNgeometry, XtCGeometry,
- XtRString, sizeof (String),
- offset (geometry), XtRString, (XtPointer) 0 },
- { XtNiconic, XtCIconic,
- XtRBoolean, sizeof (Boolean),
- offset (iconic), XtRImmediate, (XtPointer) False },
-
- { XtNemacsFrame, XtCEmacsFrame,
- XtRPointer, sizeof (XtPointer),
- offset (frame), XtRImmediate, 0 },
- { XtNmenubar, XtCMenubar,
- XtRBoolean, sizeof (Boolean),
- offset (menubar_p), XtRImmediate, (XtPointer) True },
- { XtNinitiallyUnmapped, XtCInitiallyUnmapped,
- XtRBoolean, sizeof (Boolean),
- offset (initially_unmapped), XtRImmediate, (XtPointer) False },
- { XtNminibuffer, XtCMinibuffer,
- XtRBoolean, sizeof (Boolean),
- offset (minibuffer), XtRImmediate, (XtPointer) True },
- { XtNunsplittable, XtCUnsplittable,
- XtRBoolean, sizeof (Boolean),
- offset (unsplittable), XtRImmediate, (XtPointer) False },
- { XtNinternalBorderWidth, XtCInternalBorderWidth,
- XtRInt, sizeof (int),
- offset (internal_border_width), XtRImmediate, (XtPointer)4 },
+ res (XtNgeometry, XtCGeometry, XtRString, String, geometry, XtRString, 0),
+ res (XtNiconic, XtCIconic, XtRBoolean, Boolean, iconic, XtRImmediate, False),
+
+ res (XtNemacsFrame, XtCEmacsFrame, XtRPointer, XtPointer,
+ frame, XtRImmediate, 0),
+ res (XtNmenubar, XtCMenubar, XtRBoolean, Boolean,
+ menubar_p, XtRImmediate, True),
+ res (XtNinitiallyUnmapped, XtCInitiallyUnmapped, XtRBoolean, Boolean,
+ initially_unmapped, XtRImmediate, False),
+ res (XtNminibuffer, XtCMinibuffer, XtRBoolean, Boolean,
+ minibuffer, XtRImmediate, True),
+ res (XtNunsplittable, XtCUnsplittable, XtRBoolean, Boolean,
+ unsplittable, XtRImmediate, False),
+ res (XtNinternalBorderWidth, XtCInternalBorderWidth, XtRInt, int,
+ internal_border_width, XtRImmediate, 4),
#ifdef HAVE_SCROLLBARS
- { XtNscrollBarWidth, XtCScrollBarWidth,
- XtRInt, sizeof (int),
- offset (scrollbar_width), XtRImmediate, (XtPointer)-1 },
- { XtNscrollBarHeight, XtCScrollBarHeight,
- XtRInt, sizeof (int),
- offset (scrollbar_height), XtRImmediate, (XtPointer)-1 },
- { XtNscrollBarPlacement, XtCScrollBarPlacement,
- XtRScrollBarPlacement, sizeof (unsigned char),
- offset (scrollbar_placement), XtRImmediate,
+ res (XtNscrollBarWidth, XtCScrollBarWidth, XtRInt, int,
+ scrollbar_width, XtRImmediate, -1),
+ res (XtNscrollBarHeight, XtCScrollBarHeight, XtRInt, int,
+ scrollbar_height, XtRImmediate, -1),
+ res (XtNscrollBarPlacement, XtCScrollBarPlacement, XtRScrollBarPlacement,
+ unsigned char, scrollbar_placement, XtRImmediate,
#if defined (LWLIB_SCROLLBARS_MOTIF) || defined (LWLIB_SCROLLBARS_LUCID) || \
defined (LWLIB_SCROLLBARS_ATHENA3D)
- (XtPointer) XtBOTTOM_RIGHT
+ XtBOTTOM_RIGHT
#else
- (XtPointer) XtBOTTOM_LEFT
+ XtBOTTOM_LEFT
#endif
- },
+ ),
#endif /* HAVE_SCROLLBARS */
#ifdef HAVE_TOOLBARS
- { XtNtopToolBarHeight, XtCTopToolBarHeight,
- XtRInt, sizeof (int),
- offset (top_toolbar_height), XtRImmediate, (XtPointer)-1 },
- { XtNbottomToolBarHeight, XtCBottomToolBarHeight,
- XtRInt, sizeof (int),
- offset (bottom_toolbar_height), XtRImmediate, (XtPointer)-1 },
- { XtNleftToolBarWidth, XtCLeftToolBarWidth,
- XtRInt, sizeof (int),
- offset (left_toolbar_width), XtRImmediate, (XtPointer)-1 },
- { XtNrightToolBarWidth, XtCRightToolBarWidth,
- XtRInt, sizeof (int),
- offset (right_toolbar_width), XtRImmediate, (XtPointer)-1 },
- { XtNtopToolBarBorderWidth, XtCTopToolBarBorderWidth,
- XtRInt, sizeof (int),
- offset (top_toolbar_border_width), XtRImmediate, (XtPointer)-1 },
- { XtNbottomToolBarBorderWidth, XtCBottomToolBarBorderWidth,
- XtRInt, sizeof (int),
- offset (bottom_toolbar_border_width), XtRImmediate, (XtPointer)-1 },
- { XtNleftToolBarBorderWidth, XtCLeftToolBarBorderWidth,
- XtRInt, sizeof (int),
- offset (left_toolbar_border_width), XtRImmediate, (XtPointer)-1 },
- { XtNrightToolBarBorderWidth, XtCRightToolBarBorderWidth,
- XtRInt, sizeof (int),
- offset (right_toolbar_border_width), XtRImmediate, (XtPointer)-1 },
- { XtNtoolBarShadowThickness, XtCToolBarShadowThickness,
- XtRDimension, sizeof (Dimension),
- offset (toolbar_shadow_thickness), XtRImmediate, (XtPointer)2 },
+ res (XtNtopToolBarHeight, XtCTopToolBarHeight, XtRInt, int,
+ top_toolbar_height, XtRImmediate, -1),
+ res (XtNbottomToolBarHeight, XtCBottomToolBarHeight, XtRInt, int,
+ bottom_toolbar_height, XtRImmediate, -1),
+ res (XtNleftToolBarWidth, XtCLeftToolBarWidth, XtRInt, int,
+ left_toolbar_width, XtRImmediate, -1),
+ res (XtNrightToolBarWidth, XtCRightToolBarWidth, XtRInt, int,
+ right_toolbar_width, XtRImmediate, -1),
+ res (XtNtopToolBarBorderWidth, XtCTopToolBarBorderWidth, XtRInt, int,
+ top_toolbar_border_width, XtRImmediate, -1),
+ res (XtNbottomToolBarBorderWidth, XtCBottomToolBarBorderWidth, XtRInt, int,
+ bottom_toolbar_border_width, XtRImmediate, -1),
+ res (XtNleftToolBarBorderWidth, XtCLeftToolBarBorderWidth, XtRInt,
+ int, left_toolbar_border_width, XtRImmediate, -1),
+ res (XtNrightToolBarBorderWidth, XtCRightToolBarBorderWidth, XtRInt,
+ int, right_toolbar_border_width, XtRImmediate, -1),
+ res (XtNtoolBarShadowThickness, XtCToolBarShadowThickness, XtRDimension,
+ Dimension, toolbar_shadow_thickness, XtRImmediate, 2),
#endif /* HAVE_TOOLBARS */
- { XtNinterline, XtCInterline,
- XtRInt, sizeof (int),
- offset (interline), XtRImmediate, (XtPointer)0 },
- {
- XtNfont, XtCFont,
- XtRFontStruct, sizeof (XFontStruct *),
- offset(font), XtRImmediate, (XtPointer)0
- },
- { XtNforeground, XtCForeground,
- XtRPixel, sizeof (Pixel),
- offset(foreground_pixel), XtRString, (XtPointer) "Black" },
- { XtNbackground, XtCBackground,
- XtRPixel, sizeof (Pixel),
- offset(background_pixel), XtRString, (XtPointer) "Gray80" },
- { XtNcursorColor, XtCForeground,
- XtRPixel, sizeof (Pixel),
- offset(cursor_color), XtRString, (XtPointer) "XtDefaultForeground" },
- { XtNbarCursor, XtCBarCursor,
- XtRBoolean, sizeof (Boolean),
- offset (bar_cursor), XtRImmediate, (XtPointer)0 },
- { XtNvisualBell, XtCVisualBell,
- XtRBoolean, sizeof (Boolean),
- offset (visual_bell), XtRImmediate, (XtPointer)0 },
- { XtNbellVolume, XtCBellVolume,
- XtRInt, sizeof (int),
- offset (bell_volume), XtRImmediate, (XtPointer)0 },
- { XtNuseBackingStore, XtCUseBackingStore,
- XtRBoolean, sizeof (Boolean),
- offset (use_backing_store), XtRImmediate, (XtPointer)0 },
- { XtNpreferredWidth, XtCPreferredWidth,
- XtRDimension, sizeof (Dimension),
- offset (preferred_width), XtRImmediate, (XtPointer)0 },
- { XtNpreferredHeight, XtCPreferredHeight,
- XtRDimension, sizeof (Dimension),
- offset (preferred_height), XtRImmediate, (XtPointer)0 },
+ res (XtNinterline, XtCInterline, XtRInt, int,
+ interline, XtRImmediate, 0),
+ res (XtNfont, XtCFont, XtRFontStruct, XFontStruct *,
+ font, XtRImmediate, 0),
+ res (XtNforeground, XtCForeground, XtRPixel, Pixel,
+ foreground_pixel, XtRString, "Black"),
+ res (XtNbackground, XtCBackground, XtRPixel, Pixel,
+ background_pixel, XtRString, "Gray80"),
+ res (XtNcursorColor, XtCForeground, XtRPixel, Pixel,
+ cursor_color, XtRString, "XtDefaultForeground"),
+ res (XtNbarCursor, XtCBarCursor, XtRBoolean, Boolean,
+ bar_cursor, XtRImmediate, 0),
+ res (XtNvisualBell, XtCVisualBell, XtRBoolean, Boolean,
+ visual_bell, XtRImmediate, 0),
+ res (XtNbellVolume, XtCBellVolume, XtRInt, int,
+ bell_volume, XtRImmediate, 0),
+ res (XtNuseBackingStore, XtCUseBackingStore, XtRBoolean, Boolean,
+ use_backing_store, XtRImmediate, 0),
+ res (XtNpreferredWidth, XtCPreferredWidth, XtRDimension, Dimension,
+ preferred_width, XtRImmediate, 0),
+ res (XtNpreferredHeight, XtCPreferredHeight, XtRDimension, Dimension,
+ preferred_height, XtRImmediate, 0),
};
#undef offset
@@ -181,7 +148,7 @@ static XtResource resources[] = {
static XtActionsRec
emacsFrameActionsTable [] = {
- {"mapping", (XtActionProc) emacs_Xt_mapping_action},
+ { (String) "mapping", (XtActionProc) emacs_Xt_mapping_action},
};
static char
@@ -200,7 +167,7 @@ EmacsFrameClassRec emacsFrameClassRec =
#else
/* superclass */ &widgetClassRec,
#endif
- /* class_name */ "EmacsFrame",
+ /* class_name */ (String) "EmacsFrame",
/* widget_size */ sizeof (EmacsFrameRec),
/* class_initialize */ EmacsFrameClassInitialize,
/* class_part_initialize */ 0,
@@ -653,8 +620,8 @@ EmacsFrameSetCharSize (Widget widget, in
{
Arg al [2];
- XtSetArg (al [0], XtNwidth, pixel_width);
- XtSetArg (al [1], XtNheight, pixel_height);
+ Xt_SET_ARG (al [0], XtNwidth, pixel_width);
+ Xt_SET_ARG (al [1], XtNheight, pixel_height);
XtSetValues ((Widget) ew, al, countof (al));
}
}
diff -r 03ba50f7ecd7fb0dee997f30f1f1b7af746c7493 -r 726060ee587c536ac95384a055029092ea091231 src/EmacsManager.c
--- a/src/EmacsManager.c Wed Oct 29 04:02:05 2008 +0900
+++ b/src/EmacsManager.c Wed Oct 29 04:06:33 2008 +0900
@@ -32,6 +32,7 @@ Boston, MA 02111-1307, USA. */
#include <Xm/RowColumn.h>
#endif /* LWLIB_MENUBARS_MOTIF */
#include "compiler.h"
+#include "../lwlib/xt-wrappers.h"
/* For I, Emacs, am a kind god. Unlike the goddess Athena and the
Titan Motif, I require no ritual sacrifices to placate the lesser
@@ -39,15 +40,14 @@ Boston, MA 02111-1307, USA. */
static XtResource resources[] = {
#define offset(field) XtOffset(EmacsManagerWidget, emacs_manager.field)
- { XtNresizeCallback, XtCCallback,
- XtRCallback, sizeof (XtCallbackList),
- offset(resize_callback), XtRImmediate, (XtPointer) 0 },
- { XtNqueryGeometryCallback, XtCCallback,
- XtRCallback, sizeof (XtCallbackList),
- offset(query_geometry_callback), XtRImmediate, (XtPointer) 0 },
- { XtNuserData, XtCUserData,
- XtRPointer, sizeof (XtPointer),
- offset(user_data), XtRImmediate, (XtPointer) 0 },
+#define res(name,_class,intrepr,size,member,extrepr,value) \
+ Xt_RESOURCE (name, _class, intrepr, size, offset(member), extrepr, value)
+ res (XtNresizeCallback, XtCCallback, XtRCallback, XtCallbackList,
+ resize_callback, XtRImmediate, 0),
+ res (XtNqueryGeometryCallback, XtCCallback, XtRCallback, XtCallbackList,
+ query_geometry_callback, XtRImmediate, 0),
+ res (XtNuserData, XtCUserData, XtRPointer, XtPointer,
+ user_data, XtRImmediate, 0),
};
/****************************************************************
@@ -75,7 +75,7 @@ EmacsManagerClassRec emacsManagerClassRe
#else
/* superclass */ (WidgetClass) &compositeClassRec,
#endif
- /* class_name */ "EmacsManager",
+ /* class_name */ (String) "EmacsManager",
/* widget_size */ sizeof (EmacsManagerRec),
/* class_initialize */ ClassInitialize,
/* class_part_init */ NULL,
diff -r 03ba50f7ecd7fb0dee997f30f1f1b7af746c7493 -r 726060ee587c536ac95384a055029092ea091231 src/EmacsShell-sub.c
--- a/src/EmacsShell-sub.c Wed Oct 29 04:02:05 2008 +0900
+++ b/src/EmacsShell-sub.c Wed Oct 29 04:06:33 2008 +0900
@@ -89,6 +89,7 @@ Boston, MA 02111-1307, USA. */
#include <X11/Vendor.h>
#include <X11/VendorP.h>
#include "EmacsShellP.h"
+#include "../lwlib/xt-wrappers.h"
#define ABORT abort
@@ -134,30 +135,28 @@ static XtResource resources[] = {
static XtResource resources[] = {
#define offset(field) XtOffset(EMACS_SHELL_WIDGET, emacs_shell.field)
#define coreoffset(field) XtOffset(EMACS_SHELL_WIDGET, core.field)
+#define res(name,_class,member,size) \
+ { (String) name, (String) _class, XtRInt, sizeof (int), \
+ offset (member), XtRImmediate, (XtPointer)0 }
+#define motifres(name,member) \
+ { (String) name, XtCPosition, XtRPosition, sizeof (Position), \
+ coreoffset (member), XtRImmediate, (XtPointer)BIGSIZE }
#ifdef LWLIB_USES_MOTIF
/* *** BOGOSITY^10! *** The Motif VendorShell fucks around with
the default values for X and Y, for no obvious reason. This
causes Shell to indicate that the defaults of (0,0) were
program-specified, instead of letting the WM do what it wants. */
- { XtNx, XtCPosition,
- XtRPosition, sizeof (Position),
- coreoffset (x), XtRImmediate, (XtPointer)BIGSIZE },
- { XtNy, XtCPosition,
- XtRPosition, sizeof (Position),
- coreoffset (y), XtRImmediate, (XtPointer)BIGSIZE },
-#endif
- { XtNwidthCells, XtCWidthCells,
- XtRInt, sizeof (int),
- offset (width_cells), XtRImmediate, (XtPointer)0 },
- { XtNheightCells, XtCHeightCells,
- XtRInt, sizeof (int),
- offset (height_cells), XtRImmediate, (XtPointer)0 },
- { XtNminWidthCells, XtCMinWidthCells,
- XtRInt, sizeof (int),
- offset (min_width_cells), XtRImmediate, (XtPointer)0 },
- { XtNminHeightCells, XtCMinHeightCells,
- XtRInt, sizeof (int),
- offset (min_height_cells), XtRImmediate, (XtPointer)0 },
+ motifres (XtNx, x),
+ motifres (XtNy, y),
+#endif
+ res (XtNwidthCells, XtCWidthCells, width_cells, 0),
+ res (XtNheightCells, XtCHeightCells, height_cells, 0),
+ res (XtNminWidthCells, XtCMinWidthCells, min_width_cells, 0),
+ res (XtNminHeightCells, XtCMinHeightCells, min_height_cells, 0),
+#undef offset
+#undef coreoffset
+#undef res
+#undef motifres
};
static CompositeClassExtensionRec compositeClassExtRec = {
@@ -259,12 +258,12 @@ update_size_hints_internal (EMACS_SHELL_
printf (" base size set to: %d %d\n", base_width, base_height);
fflush (stdout);
#endif
- XtSetArg(al [0], XtNbaseWidth, base_width);
- XtSetArg(al [1], XtNbaseHeight, base_height);
- XtSetArg(al [2], XtNminWidth, base_width +
- cell_width * w->emacs_shell.min_width_cells);
- XtSetArg(al [3], XtNminHeight, base_height +
- cell_height * w->emacs_shell.min_height_cells);
+ Xt_SET_ARG(al [0], XtNbaseWidth, base_width);
+ Xt_SET_ARG(al [1], XtNbaseHeight, base_height);
+ Xt_SET_ARG(al [2], XtNminWidth, base_width +
+ cell_width * w->emacs_shell.min_width_cells);
+ Xt_SET_ARG(al [3], XtNminHeight, base_height +
+ cell_height * w->emacs_shell.min_height_cells);
XtSetValues ((Widget) w, al, 4);
}
diff -r 03ba50f7ecd7fb0dee997f30f1f1b7af746c7493 -r 726060ee587c536ac95384a055029092ea091231 src/console-x.h
--- a/src/console-x.h Wed Oct 29 04:02:05 2008 +0900
+++ b/src/console-x.h Wed Oct 29 04:06:33 2008 +0900
@@ -65,18 +65,6 @@ Boston, MA 02111-1307, USA. */
#if (XlibSpecificationRelease < 5)
# define XPointer char *
#endif
-
-#define Xt_SET_VALUE(widget, resource, value) do { \
- Arg al; \
- XtSetArg (al, resource, value); \
- XtSetValues (widget, &al, 1); \
-} while (0)
-
-#define Xt_GET_VALUE(widget, resource, location) do { \
- Arg al; \
- XtSetArg (al, resource, location); \
- XtGetValues (widget, &al, 1); \
-} while (0)
#ifdef __cplusplus
#define X_CLASSFIELD c_class
@@ -212,7 +200,7 @@ void describe_XIMStyles (XIMStyles *sty
void describe_XIMStyles (XIMStyles *styles);
void describe_XIC (XIC ic);
void describe_event_mask (unsigned long mask);
-void describe_XRectangle (char *name, XRectangle *rect);
+void describe_XRectangle (const char *name, XRectangle *rect);
void describe_Status (Status status);
#endif /* DEBUG_XEMACS */
#endif /* XIM_XLIB */
diff -r 03ba50f7ecd7fb0dee997f30f1f1b7af746c7493 -r 726060ee587c536ac95384a055029092ea091231 src/device-x.c
--- a/src/device-x.c Wed Oct 29 04:02:05 2008 +0900
+++ b/src/device-x.c Wed Oct 29 04:06:33 2008 +0900
@@ -79,29 +79,33 @@ Lisp_Object Vx_emacs_application_class;
Lisp_Object Vx_initial_argv_list; /* #### ugh! */
+/* Shut up G++ 4.3. */
+#define Xrm_ODR(option,resource,type,default) \
+ { (String) option, (String) resource, type, default }
+
static XrmOptionDescRec emacs_options[] =
{
- {"-geometry", ".geometry", XrmoptionSepArg, NULL},
- {"-iconic", ".iconic", XrmoptionNoArg, "yes"},
-
- {"-internal-border-width", "*EmacsFrame.internalBorderWidth", XrmoptionSepArg, NULL},
- {"-ib", "*EmacsFrame.internalBorderWidth", XrmoptionSepArg, NULL},
- {"-scrollbar-width", "*EmacsFrame.scrollBarWidth", XrmoptionSepArg, NULL},
- {"-scrollbar-height", "*EmacsFrame.scrollBarHeight", XrmoptionSepArg, NULL},
-
- {"-privatecolormap", ".privateColormap", XrmoptionNoArg, "yes"},
- {"-visual", ".EmacsVisual", XrmoptionSepArg, NULL},
+ Xrm_ODR ("-geometry", ".geometry", XrmoptionSepArg, NULL),
+ Xrm_ODR ("-iconic", ".iconic", XrmoptionNoArg, (String) "yes"),
+
+ Xrm_ODR ("-internal-border-width", "*EmacsFrame.internalBorderWidth", XrmoptionSepArg, NULL),
+ Xrm_ODR ("-ib", "*EmacsFrame.internalBorderWidth", XrmoptionSepArg, NULL),
+ Xrm_ODR ("-scrollbar-width", "*EmacsFrame.scrollBarWidth", XrmoptionSepArg, NULL),
+ Xrm_ODR ("-scrollbar-height", "*EmacsFrame.scrollBarHeight", XrmoptionSepArg, NULL),
+
+ Xrm_ODR ("-privatecolormap", ".privateColormap", XrmoptionNoArg, (String) "yes"),
+ Xrm_ODR ("-visual", ".EmacsVisual", XrmoptionSepArg, NULL),
/* #### Beware! If the type of the shell changes, update this. */
- {"-T", "*TopLevelEmacsShell.title", XrmoptionSepArg, NULL},
- {"-wn", "*TopLevelEmacsShell.title", XrmoptionSepArg, NULL},
- {"-title", "*TopLevelEmacsShell.title", XrmoptionSepArg, NULL},
-
- {"-iconname", "*TopLevelEmacsShell.iconName", XrmoptionSepArg, NULL},
- {"-in", "*TopLevelEmacsShell.iconName", XrmoptionSepArg, NULL},
- {"-mc", "*pointerColor", XrmoptionSepArg, NULL},
- {"-cr", "*cursorColor", XrmoptionSepArg, NULL},
- {"-fontset", "*FontSet", XrmoptionSepArg, NULL},
+ Xrm_ODR ("-T", "*TopLevelEmacsShell.title", XrmoptionSepArg, NULL),
+ Xrm_ODR ("-wn", "*TopLevelEmacsShell.title", XrmoptionSepArg, NULL),
+ Xrm_ODR ("-title", "*TopLevelEmacsShell.title", XrmoptionSepArg, NULL),
+
+ Xrm_ODR ("-iconname", "*TopLevelEmacsShell.iconName", XrmoptionSepArg, NULL),
+ Xrm_ODR ("-in", "*TopLevelEmacsShell.iconName", XrmoptionSepArg, NULL),
+ Xrm_ODR ("-mc", "*pointerColor", XrmoptionSepArg, NULL),
+ Xrm_ODR ("-cr", "*cursorColor", XrmoptionSepArg, NULL),
+ Xrm_ODR ("-fontset", "*FontSet", XrmoptionSepArg, NULL),
};
static const struct memory_description x_device_data_description_1 [] = {
@@ -329,7 +333,7 @@ compute_x_app_name (int argc, Extbyte **
if (argc > 0 && argv[0] && *argv[0])
return (ptr = strrchr (argv[0], '/')) ? ++ptr : argv[0];
- return "xemacs";
+ return (Extbyte *) "xemacs"; /* shut up g++ 4.3 */
}
/*
@@ -343,7 +347,7 @@ static int
static int
have_xemacs_resources_in_xrdb (Display *dpy)
{
- char *xdefs, *key;
+ const char *xdefs, *key;
int len;
#ifdef INFODOCK
@@ -688,9 +692,9 @@ x_init_device (struct device *d, Lisp_Ob
does not override resources defined elsewhere */
const Extbyte *data_dir;
Extbyte *path;
- Extbyte *format;
+ const Extbyte *format;
XrmDatabase db = XtDatabase (dpy); /* #### XtScreenDatabase(dpy) ? */
- Extbyte *locale = xstrdup (XrmLocaleOfDatabase (db));
+ const Extbyte *locale = xstrdup (XrmLocaleOfDatabase (db));
Extbyte *locale_end;
if (STRINGP (Vx_app_defaults_directory) &&
@@ -739,7 +743,11 @@ x_init_device (struct device *d, Lisp_Ob
}
no_data_directory:
- xfree (locale, Extbyte*);
+ {
+ /* Cast off const for G++ 4.3. */
+ Extbyte *temp = (Extbyte *) locale;
+ xfree (temp, Extbyte*);
+ }
}
#endif /* MULE */
@@ -861,9 +869,9 @@ x_init_device (struct device *d, Lisp_Ob
be the place. Make sure it doesn't conflict with GNOME. */
{
Arg al[3];
- XtSetArg (al[0], XtNvisual, visual);
- XtSetArg (al[1], XtNdepth, depth);
- XtSetArg (al[2], XtNcolormap, cmap);
+ Xt_SET_ARG (al[0], XtNvisual, visual);
+ Xt_SET_ARG (al[1], XtNdepth, depth);
+ Xt_SET_ARG (al[2], XtNcolormap, cmap);
app_shell = XtAppCreateShell (NULL, app_class,
applicationShellWidgetClass,
@@ -880,11 +888,13 @@ x_init_device (struct device *d, Lisp_Ob
and set it to the size of the root window for child placement purposes */
{
Arg al[5];
- XtSetArg (al[0], XtNmappedWhenManaged, False);
- XtSetArg (al[1], XtNx, 0);
- XtSetArg (al[2], XtNy, 0);
- XtSetArg (al[3], XtNwidth, WidthOfScreen (ScreenOfDisplay (dpy, screen)));
- XtSetArg (al[4], XtNheight, HeightOfScreen (ScreenOfDisplay (dpy, screen)));
+ Xt_SET_ARG (al[0], XtNmappedWhenManaged, False);
+ Xt_SET_ARG (al[1], XtNx, 0);
+ Xt_SET_ARG (al[2], XtNy, 0);
+ Xt_SET_ARG (al[3], XtNwidth,
+ WidthOfScreen (ScreenOfDisplay (dpy, screen)));
+ Xt_SET_ARG (al[4], XtNheight,
+ HeightOfScreen (ScreenOfDisplay (dpy, screen)));
XtSetValues (app_shell, al, countof (al));
XtRealizeWidget (app_shell);
}
diff -r 03ba50f7ecd7fb0dee997f30f1f1b7af746c7493 -r 726060ee587c536ac95384a055029092ea091231 src/emacs.c
--- a/src/emacs.c Wed Oct 29 04:02:05 2008 +0900
+++ b/src/emacs.c Wed Oct 29 04:06:33 2008 +0900
@@ -806,7 +806,7 @@ Return the directory name in which the E
enough information to do it right. */
static int
-argmatch (Wexttext **argv, int argc, Ascbyte *sstr, Ascbyte *lstr,
+argmatch (Wexttext **argv, int argc, const Ascbyte *sstr, const Ascbyte *lstr,
int minlen, Wexttext **valptr, int *skipptr)
{
Wexttext *p = NULL;
@@ -862,7 +862,7 @@ argmatch (Wexttext **argv, int argc, Asc
}
static void
-check_compatible_window_system (Ascbyte *must)
+check_compatible_window_system (const Ascbyte *must)
{
if (display_use && strcmp (display_use, must))
fatal ("Incompatible window system type `%s': `%s' already specified",
diff -r 03ba50f7ecd7fb0dee997f30f1f1b7af746c7493 -r 726060ee587c536ac95384a055029092ea091231 src/emodules.c
--- a/src/emodules.c Wed Oct 29 04:02:05 2008 +0900
+++ b/src/emodules.c Wed Oct 29 04:06:33 2008 +0900
@@ -96,7 +96,7 @@ the variable `load-modules-quietly' is n
*/
(file, name, version))
{
- CIbyte *mod, *mname, *mver;
+ const CIbyte *mod, *mname, *mver;
int speccount = specpdl_depth();
CHECK_STRING(file);
@@ -136,7 +136,7 @@ soon as the last reference to symbols wi
(file, name, version))
{
int x;
- CIbyte *mod, *mname, *mver;
+ const CIbyte *mod, *mname, *mver;
Lisp_Object foundname = Qnil;
struct gcpro gcpro1;
diff -r 03ba50f7ecd7fb0dee997f30f1f1b7af746c7493 -r 726060ee587c536ac95384a055029092ea091231 src/event-Xt.c
--- a/src/event-Xt.c Wed Oct 29 04:02:05 2008 +0900
+++ b/src/event-Xt.c Wed Oct 29 04:06:33 2008 +0900
@@ -109,7 +109,9 @@ extern SELECT_TYPE input_wait_mask, non_
extern SELECT_TYPE input_wait_mask, non_fake_input_wait_mask;
extern SELECT_TYPE process_only_mask, tty_only_mask;
-static const String x_fallback_resources[] =
+/* #### This should be String, but G++ 4.3 doesn't apply the const
+ specifier the same way for String (typedef'd to char*) and char*. */
+static const char * x_fallback_resources[] =
{
/* This file is automatically generated from the app-defaults file
in ../etc/Emacs.ad. These resources are consulted only if no
@@ -3126,8 +3128,8 @@ emacs_Xt_event_widget_focus_out (Widget
static XtActionsRec widgetActionsList[] =
{
- {"widget-focus-in", emacs_Xt_event_widget_focus_in },
- {"widget-focus-out", emacs_Xt_event_widget_focus_out },
+ { (String) "widget-focus-in", emacs_Xt_event_widget_focus_in },
+ { (String) "widget-focus-out", emacs_Xt_event_widget_focus_out },
};
static void
diff -r 03ba50f7ecd7fb0dee997f30f1f1b7af746c7493 -r 726060ee587c536ac95384a055029092ea091231 src/event-stream.c
--- a/src/event-stream.c Wed Oct 29 04:02:05 2008 +0900
+++ b/src/event-stream.c Wed Oct 29 04:06:33 2008 +0900
@@ -255,7 +255,7 @@ Fixnum debug_emacs_events;
Fixnum debug_emacs_events;
static void
-external_debugging_print_event (char *event_description, Lisp_Object event)
+external_debugging_print_event (const char *event_description, Lisp_Object event)
{
write_c_string (Qexternal_debugging_output, "(");
write_c_string (Qexternal_debugging_output, event_description);
diff -r 03ba50f7ecd7fb0dee997f30f1f1b7af746c7493 -r 726060ee587c536ac95384a055029092ea091231 src/file-coding.c
--- a/src/file-coding.c Wed Oct 29 04:02:05 2008 +0900
+++ b/src/file-coding.c Wed Oct 29 04:06:33 2008 +0900
@@ -897,8 +897,8 @@ eol_type_to_symbol (enum eol_type type)
struct subsidiary_type
{
- Ascbyte *extension;
- Ascbyte *mnemonic_ext;
+ const Ascbyte *extension;
+ const Ascbyte *mnemonic_ext;
enum eol_type eol;
};
@@ -944,8 +944,8 @@ setup_eol_coding_systems (Lisp_Object co
for (i = 0; i < countof (coding_subsidiary_list); i++)
{
- Ascbyte *extension = coding_subsidiary_list[i].extension;
- Ascbyte *mnemonic_ext = coding_subsidiary_list[i].mnemonic_ext;
+ const Ascbyte *extension = coding_subsidiary_list[i].extension;
+ const Ascbyte *mnemonic_ext = coding_subsidiary_list[i].mnemonic_ext;
enum eol_type eol = coding_subsidiary_list[i].eol;
qxestrcpy_ascii (codesys_name + len, extension);
@@ -1021,7 +1021,7 @@ setup_eol_coding_systems (Lisp_Object co
*/
static Lisp_Object
-make_coding_system_1 (Lisp_Object name_or_existing, Ascbyte *prefix,
+make_coding_system_1 (Lisp_Object name_or_existing, const Ascbyte *prefix,
Lisp_Object type, Lisp_Object description,
Lisp_Object props)
{
@@ -1192,7 +1192,7 @@ make_coding_system_1 (Lisp_Object name_o
}
Lisp_Object
-make_internal_coding_system (Lisp_Object existing, Ascbyte *prefix,
+make_internal_coding_system (Lisp_Object existing, const Ascbyte *prefix,
Lisp_Object type, Lisp_Object description,
Lisp_Object props)
{
diff -r 03ba50f7ecd7fb0dee997f30f1f1b7af746c7493 -r 726060ee587c536ac95384a055029092ea091231 src/file-coding.h
--- a/src/file-coding.h Wed Oct 29 04:02:05 2008 +0900
+++ b/src/file-coding.h Wed Oct 29 04:06:33 2008 +0900
@@ -1046,7 +1046,7 @@ Ichar decode_big5_char (int o1, int o2);
Ichar decode_big5_char (int o1, int o2);
void add_entry_to_coding_system_type_list (struct coding_system_methods *m);
Lisp_Object make_internal_coding_system (Lisp_Object existing,
- Ascbyte *prefix,
+ const Ascbyte *prefix,
Lisp_Object type,
Lisp_Object description,
Lisp_Object props);
diff -r 03ba50f7ecd7fb0dee997f30f1f1b7af746c7493 -r 726060ee587c536ac95384a055029092ea091231 src/frame-x.c
--- a/src/frame-x.c Wed Oct 29 04:02:05 2008 +0900
+++ b/src/frame-x.c Wed Oct 29 04:06:33 2008 +0900
@@ -280,8 +280,8 @@ x_wm_set_cell_size (Widget wmshell, int
if (cw <= 0 || ch <= 0)
ABORT ();
- XtSetArg (al[0], XtNwidthInc, cw);
- XtSetArg (al[1], XtNheightInc, ch);
+ Xt_SET_ARG (al[0], XtNwidthInc, cw);
+ Xt_SET_ARG (al[1], XtNheightInc, ch);
XtSetValues (wmshell, al, 2);
}
@@ -298,8 +298,8 @@ x_wm_set_variable_size (Widget wmshell,
fflush (stdout);
#endif
- XtSetArg (al[0], XtNwidthCells, width);
- XtSetArg (al[1], XtNheightCells, height);
+ Xt_SET_ARG (al[0], XtNwidthCells, width);
+ Xt_SET_ARG (al[1], XtNheightCells, height);
XtSetValues (wmshell, al, 2);
}
@@ -668,8 +668,8 @@ x_set_frame_text_value (struct frame *f,
if (!old_XtValue || strcmp (new_XtValue, old_XtValue))
{
Arg al[2];
- XtSetArg (al[0], Xt_resource_name, new_XtValue);
- XtSetArg (al[1], Xt_resource_encoding_name, encoding);
+ Xt_SET_ARG (al[0], Xt_resource_name, new_XtValue);
+ Xt_SET_ARG (al[1], Xt_resource_encoding_name, encoding);
XtSetValues (FRAME_X_SHELL_WIDGET (f), al, 2);
}
}
@@ -1539,8 +1539,8 @@ x_initialize_frame_size (struct frame *f
if (! (frame_flags & (WidthValue | HeightValue)))
{
Arg al[2];
- XtSetArg (al [0], XtNwidth, &frame_w);
- XtSetArg (al [1], XtNheight, &frame_h);
+ Xt_SET_ARG (al [0], XtNwidth, &frame_w);
+ Xt_SET_ARG (al [1], XtNheight, &frame_h);
XtGetValues (ew, al, 2);
if (!frame_w && !frame_h)
{
@@ -1554,8 +1554,8 @@ x_initialize_frame_size (struct frame *f
if (frame_flags & (XValue | YValue))
{
Arg al[2];
- XtSetArg (al [0], XtNwidth, &frame_w);
- XtSetArg (al [1], XtNheight, &frame_h);
+ Xt_SET_ARG (al [0], XtNwidth, &frame_w);
+ Xt_SET_ARG (al [1], XtNheight, &frame_h);
XtGetValues (ew, al, 2);
if (frame_flags & XNegative)
@@ -1563,8 +1563,8 @@ x_initialize_frame_size (struct frame *f
if (frame_flags & YNegative)
frame_y += frame_h;
- XtSetArg (al [0], XtNx, frame_x);
- XtSetArg (al [1], XtNy, frame_y);
+ Xt_SET_ARG (al [0], XtNx, frame_x);
+ Xt_SET_ARG (al [1], XtNy, frame_y);
XtSetValues (ew, al, 2);
}
return;
@@ -1869,40 +1869,40 @@ x_create_widgets (struct frame *f, Lisp_
FRAME_X_TOP_LEVEL_FRAME_P (f) = 1;
ac = 0;
- XtSetArg (al[ac], XtNallowShellResize, True); ac++;
+ Xt_SET_ARG (al[ac], XtNallowShellResize, True); ac++;
#ifdef LWLIB_USES_MOTIF
/* Motif sucks beans. Without this in here, it will delete the window
out from under us when it receives a WM_DESTROY_WINDOW message
from the WM. */
- XtSetArg (al[ac], XmNdeleteResponse, XmDO_NOTHING); ac++;
+ Xt_SET_ARG (al[ac], XmNdeleteResponse, XmDO_NOTHING); ac++;
#endif
#ifdef EXTERNAL_WIDGET
if (window_id)
{
- XtSetArg (al[ac], XtNwindow, window_id); ac++;
+ Xt_SET_ARG (al[ac], XtNwindow, window_id); ac++;
}
else
#endif /* EXTERNAL_WIDGET */
{
- XtSetArg (al[ac], XtNinput, True); ac++;
- XtSetArg (al[ac], XtNminWidthCells, 10); ac++;
- XtSetArg (al[ac], XtNminHeightCells, 1); ac++;
- XtSetArg (al[ac], XtNvisual, visual); ac++;
- XtSetArg (al[ac], XtNdepth, depth); ac++;
- XtSetArg (al[ac], XtNcolormap, cmap); ac++;
+ Xt_SET_ARG (al[ac], XtNinput, True); ac++;
+ Xt_SET_ARG (al[ac], XtNminWidthCells, 10); ac++;
+ Xt_SET_ARG (al[ac], XtNminHeightCells, 1); ac++;
+ Xt_SET_ARG (al[ac], XtNvisual, visual); ac++;
+ Xt_SET_ARG (al[ac], XtNdepth, depth); ac++;
+ Xt_SET_ARG (al[ac], XtNcolormap, cmap); ac++;
}
if (!NILP (overridep))
{
- XtSetArg (al[ac], XtNoverrideRedirect, True); ac++;
+ Xt_SET_ARG (al[ac], XtNoverrideRedirect, True); ac++;
}
/* #### maybe we should check for FRAMEP instead? */
if (!NILP (parent))
{
parentwid = FRAME_X_SHELL_WIDGET (XFRAME (parent));
- XtSetArg (al[ac], XtNtransientFor, parentwid); ac++;
+ Xt_SET_ARG (al[ac], XtNtransientFor, parentwid); ac++;
}
shell = XtCreatePopupShell ("shell",
@@ -1921,9 +1921,9 @@ x_create_widgets (struct frame *f, Lisp_
/* Create the manager widget */
ac = 0;
- XtSetArg (al[ac], XtNvisual, visual); ac++;
- XtSetArg (al[ac], XtNdepth, depth); ac++;
- XtSetArg (al[ac], XtNcolormap, cmap); ac++;
+ Xt_SET_ARG (al[ac], XtNvisual, visual); ac++;
+ Xt_SET_ARG (al[ac], XtNdepth, depth); ac++;
+ Xt_SET_ARG (al[ac], XtNcolormap, cmap); ac++;
container = XtCreateWidget ("container",
emacsManagerWidgetClass, shell, al, ac);
@@ -1935,11 +1935,11 @@ x_create_widgets (struct frame *f, Lisp_
/* Create the text area */
ac = 0;
- XtSetArg (al[ac], XtNvisual, visual); ac++;
- XtSetArg (al[ac], XtNdepth, depth); ac++;
- XtSetArg (al[ac], XtNcolormap, cmap); ac++;
- XtSetArg (al[ac], XtNborderWidth, 0); ac++; /* should this be settable? */
- XtSetArg (al[ac], XtNemacsFrame, f); ac++;
+ Xt_SET_ARG (al[ac], XtNvisual, visual); ac++;
+ Xt_SET_ARG (al[ac], XtNdepth, depth); ac++;
+ Xt_SET_ARG (al[ac], XtNcolormap, cmap); ac++;
+ Xt_SET_ARG (al[ac], XtNborderWidth, 0); ac++; /* should this be settable? */
+ Xt_SET_ARG (al[ac], XtNemacsFrame, f); ac++;
text = XtCreateWidget (name, emacsFrameClass, container, al, ac);
FRAME_X_TEXT_WIDGET (f) = text;
@@ -2198,8 +2198,8 @@ x_set_frame_icon (struct frame *f)
/* Store the X data into the widget. */
{
Arg al[2];
- XtSetArg (al[0], XtNiconPixmap, x_pixmap);
- XtSetArg (al[1], XtNiconMask, x_mask);
+ Xt_SET_ARG (al[0], XtNiconPixmap, x_pixmap);
+ Xt_SET_ARG (al[1], XtNiconMask, x_mask);
XtSetValues (FRAME_X_SHELL_WIDGET (f), al, 2);
}
}
@@ -2264,9 +2264,9 @@ x_set_frame_position (struct frame *f, i
int win_gravity;
Arg al[3];
- XtSetArg (al[0], XtNwidth, &shell_w);
- XtSetArg (al[1], XtNheight, &shell_h);
- XtSetArg (al[2], XtNborderWidth, &shell_bord);
+ Xt_SET_ARG (al[0], XtNwidth, &shell_w);
+ Xt_SET_ARG (al[1], XtNheight, &shell_h);
+ Xt_SET_ARG (al[2], XtNborderWidth, &shell_bord);
XtGetValues (w, al, 3);
win_gravity =
@@ -2283,9 +2283,9 @@ x_set_frame_position (struct frame *f, i
come back at the right place. We can't look at s->visible to determine
whether it is iconified because it might not be up-to-date yet (the queue
might not be processed). */
- XtSetArg (al[0], XtNwinGravity, win_gravity);
- XtSetArg (al[1], XtNx, xoff);
- XtSetArg (al[2], XtNy, yoff);
+ Xt_SET_ARG (al[0], XtNwinGravity, win_gravity);
+ Xt_SET_ARG (al[1], XtNx, xoff);
+ Xt_SET_ARG (al[2], XtNy, yoff);
XtSetValues (w, al, 3);
/* Sometimes you will find that
@@ -2709,7 +2709,7 @@ x_update_frame_external_traits (struct f
if (!EQ (color, Vthe_null_color_instance))
{
fgc = COLOR_INSTANCE_X_COLOR (XCOLOR_INSTANCE (color));
- XtSetArg (al[ac], XtNforeground, (void *) fgc.pixel); ac++;
+ Xt_SET_ARG (al[ac], XtNforeground, (void *) fgc.pixel); ac++;
}
}
else if (EQ (name, Qbackground))
@@ -2720,7 +2720,7 @@ x_update_frame_external_traits (struct f
if (!EQ (color, Vthe_null_color_instance))
{
bgc = COLOR_INSTANCE_X_COLOR (XCOLOR_INSTANCE (color));
- XtSetArg (al[ac], XtNbackground, (void *) bgc.pixel); ac++;
+ Xt_SET_ARG (al[ac], XtNbackground, (void *) bgc.pixel); ac++;
}
/* Really crappy way to force the modeline shadows to be
@@ -2754,15 +2754,15 @@ x_update_frame_external_traits (struct f
#ifdef USE_XFT
else if (FONT_INSTANCE_X_XFTFONT (XFONT_INSTANCE (font)))
{
- XtSetArg (al[ac], XtNxftFont,
+ Xt_SET_ARG (al[ac], XtNxftFont,
(void *) FONT_INSTANCE_X_XFTFONT (XFONT_INSTANCE (font)));
ac++;
}
#endif
else if (FONT_INSTANCE_X_FONT (XFONT_INSTANCE (font)))
{
- XtSetArg (al[ac], XtNfont,
- (void *) FONT_INSTANCE_X_FONT (XFONT_INSTANCE (font)));
+ Xt_SET_ARG (al[ac], XtNfont,
+ (void *) FONT_INSTANCE_X_FONT (XFONT_INSTANCE (font)));
ac++;
}
}
diff -r 03ba50f7ecd7fb0dee997f30f1f1b7af746c7493 -r 726060ee587c536ac95384a055029092ea091231 src/gif_io.c
--- a/src/gif_io.c Wed Oct 29 04:02:05 2008 +0900
+++ b/src/gif_io.c Wed Oct 29 04:06:33 2008 +0900
@@ -140,7 +140,7 @@ int GifClose(GifFileType *GifFile)
return ((*(GifIO->CloseFunc))(GifIO->CloseFunc_data));
}
-static char *GifErrorString[14] = {
+static const char *GifErrorString[14] = {
"Failed to open given file", /* D_GIF_ERR_OPEN_FAILED */
"Failed to read from given file", /* D_GIF_ERR_READ_FAILED */
"Given file is NOT a GIF file", /* D_GIF_ERR_NOT_GIF_FILE */
@@ -164,7 +164,7 @@ const char *GetGifError(int errore);
*****************************************************************************/
const char *GetGifError(int errore)
{
- char *Err;
+ const char *Err;
switch(errore) {
case D_GIF_ERR_OPEN_FAILED:
diff -r 03ba50f7ecd7fb0dee997f30f1f1b7af746c7493 -r 726060ee587c536ac95384a055029092ea091231 src/glyphs-x.c
--- a/src/glyphs-x.c Wed Oct 29 04:02:05 2008 +0900
+++ b/src/glyphs-x.c Wed Oct 29 04:06:33 2008 +0900
@@ -2234,8 +2234,8 @@ x_redisplay_widget (Lisp_Image_Instance
if (XFRAME (IMAGE_INSTANCE_FRAME (p))->size_changed)
{
Arg al[2];
- XtSetArg (al [0], XtNx, &IMAGE_INSTANCE_X_WIDGET_XOFFSET (p));
- XtSetArg (al [1], XtNy, &IMAGE_INSTANCE_X_WIDGET_YOFFSET (p));
+ Xt_SET_ARG (al [0], XtNx, &IMAGE_INSTANCE_X_WIDGET_XOFFSET (p));
+ Xt_SET_ARG (al [1], XtNy, &IMAGE_INSTANCE_X_WIDGET_YOFFSET (p));
XtGetValues (FRAME_X_TEXT_WIDGET
(XFRAME (IMAGE_INSTANCE_FRAME (p))), al, 2);
}
@@ -2424,7 +2424,7 @@ update_tab_widget_face (widget_value* wv
(IMAGE_INSTANCE_WIDGET_FACE (ii),
domain);
XColor fcolor = COLOR_INSTANCE_X_COLOR (XCOLOR_INSTANCE (pixel));
- lw_add_widget_value_arg (val, XtNtabForeground, fcolor.pixel);
+ lw_add_widget_value_arg (val, (String) XtNtabForeground, fcolor.pixel);
wv->change = VISIBLE_CHANGE;
val->change = VISIBLE_CHANGE;
@@ -2539,8 +2539,8 @@ x_widget_instantiate (Lisp_Object image_
offset the redisplay of the widget by the amount the text
widget is inside the manager. */
ac = 0;
- XtSetArg (al [ac], XtNx, &IMAGE_INSTANCE_X_WIDGET_XOFFSET (ii)); ac++;
- XtSetArg (al [ac], XtNy, &IMAGE_INSTANCE_X_WIDGET_YOFFSET (ii)); ac++;
+ Xt_SET_ARG (al [ac], XtNx, &IMAGE_INSTANCE_X_WIDGET_XOFFSET (ii)); ac++;
+ Xt_SET_ARG (al [ac], XtNy, &IMAGE_INSTANCE_X_WIDGET_YOFFSET (ii)); ac++;
XtGetValues (FRAME_X_TEXT_WIDGET (f), al, ac);
XtSetMappedWhenManaged (wid, TRUE);
@@ -2608,11 +2608,11 @@ x_button_instantiate (Lisp_Object image_
Arg al [2];
int ac =0;
#ifdef LWLIB_WIDGETS_MOTIF
- XtSetArg (al [ac], XmNlabelType, XmPIXMAP); ac++;
- XtSetArg (al [ac], XmNlabelPixmap, XIMAGE_INSTANCE_X_PIXMAP (glyph));
+ Xt_SET_ARG (al [ac], XmNlabelType, XmPIXMAP); ac++;
+ Xt_SET_ARG (al [ac], XmNlabelPixmap, XIMAGE_INSTANCE_X_PIXMAP (glyph));
ac++;
#else
- XtSetArg (al [ac], XtNpixmap, XIMAGE_INSTANCE_X_PIXMAP (glyph)); ac++;
+ Xt_SET_ARG (al [ac], XtNpixmap, XIMAGE_INSTANCE_X_PIXMAP (glyph)); ac++;
#endif
XtSetValues (IMAGE_INSTANCE_X_WIDGET_ID (ii), al, ac);
}
@@ -2683,11 +2683,9 @@ x_progress_gauge_redisplay (Lisp_Object
if (IMAGE_INSTANCE_WIDGET_ITEMS_CHANGED (p))
{
- Arg al [1];
Lisp_Object val;
val = XGUI_ITEM (IMAGE_INSTANCE_WIDGET_PENDING_ITEMS (p))->value;
- XtSetArg (al[0], XtNvalue, XINT (val));
- XtSetValues (IMAGE_INSTANCE_X_WIDGET_ID (p), al, 1);
+ Xt_SET_VALUE (IMAGE_INSTANCE_X_WIDGET_ID (p), XtNvalue, XINT (val));
}
}
@@ -2773,7 +2771,6 @@ x_tab_control_redisplay (Lisp_Object ima
Lisp_Object old_selected =
gui_item_list_find_selected
(XCDR (IMAGE_INSTANCE_WIDGET_ITEMS (ii)));
- Arg al [1];
char* name;
unsigned int num_children, i;
Widget* children;
@@ -2789,8 +2786,8 @@ x_tab_control_redisplay (Lisp_Object ima
{
if (!strcmp (XtName (children [i]), name))
{
- XtSetArg (al [0], XtNtopWidget, children [i]);
- XtSetValues (IMAGE_INSTANCE_X_WIDGET_ID (ii), al, 1);
+ Xt_SET_VALUE (IMAGE_INSTANCE_X_WIDGET_ID (ii),
+ XtNtopWidget, children [i]);
break;
}
}
diff -r 03ba50f7ecd7fb0dee997f30f1f1b7af746c7493 -r 726060ee587c536ac95384a055029092ea091231 src/input-method-xlib.c
--- a/src/input-method-xlib.c Wed Oct 29 04:02:05 2008 +0900
+++ b/src/input-method-xlib.c Wed Oct 29 04:06:33 2008 +0900
@@ -286,19 +286,19 @@ XIM_init_frame (struct frame *f)
xic_vars_t xic_vars;
XIC xic;
-#define res(name, class_, representation, field, default_value) \
- { name, class_, representation, sizeof(xic_vars.field), \
- XtOffsetOf(xic_vars_t, field), XtRString, default_value }
+#define res(name, class_, representation, field, default_value) \
+ Xt_RESOURCE (name, class_, representation, xic_vars.field, \
+ XtOffsetOf(xic_vars_t, field), XtRString, default_value)
static XtResource resources[] =
{
/* name class represent'n field default value */
- res(XtNximStyles, XtCXimStyles, XtRXimStyles, styles, (XtPointer) DefaultXIMStyles),
- res(XtNfontSet, XtCFontSet, XtRFontSet, fontset, (XtPointer) XtDefaultFontSet),
- res(XtNximForeground, XtCForeground, XtRPixel, fg, (XtPointer) XtDefaultForeground),
- res(XtNximBackground, XtCBackground, XtRPixel, bg, (XtPointer) XtDefaultBackground)
+ res(XtNximStyles, XtCXimStyles, XtRXimStyles, styles, DefaultXIMStyles),
+ res(XtNfontSet, XtCFontSet, XtRFontSet, fontset, XtDefaultFontSet),
+ res(XtNximForeground, XtCForeground, XtRPixel, fg, XtDefaultForeground),
+ res(XtNximBackground, XtCBackground, XtRPixel, bg, XtDefaultBackground)
};
-
+#undef res
xim = DEVICE_X_XIM (d);
@@ -977,7 +977,7 @@ describe_XIC (XIC xic)
}
void
-describe_XRectangle (char *name, XRectangle *r)
+describe_XRectangle (const char *name, XRectangle *r)
{
if (r == NULL)
stderr_out ("%s: NULL\n", name);
diff -r 03ba50f7ecd7fb0dee997f30f1f1b7af746c7493 -r 726060ee587c536ac95384a055029092ea091231 src/menubar-x.c
--- a/src/menubar-x.c Wed Oct 29 04:02:05 2008 +0900
+++ b/src/menubar-x.c Wed Oct 29 04:06:33 2008 +0900
@@ -690,13 +690,13 @@ make_dummy_xbutton_event (XEvent *dummy,
{
Widget shell = XtParent (daddy);
- XtSetArg (al [0], XtNx, &shellx);
- XtSetArg (al [1], XtNy, &shelly);
+ Xt_SET_ARG (al [0], XtNx, &shellx);
+ Xt_SET_ARG (al [1], XtNy, &shelly);
XtGetValues (shell, al, 2);
}
#endif
- XtSetArg (al [0], XtNx, &framex);
- XtSetArg (al [1], XtNy, &framey);
+ Xt_SET_ARG (al [0], XtNx, &framex);
+ Xt_SET_ARG (al [1], XtNy, &framey);
XtGetValues (daddy, al, 2);
btn->x_root = shellx + framex + btn->x;
btn->y_root = shelly + framey + btn->y;
diff -r 03ba50f7ecd7fb0dee997f30f1f1b7af746c7493 -r 726060ee587c536ac95384a055029092ea091231 src/mule-coding.c
--- a/src/mule-coding.c Wed Oct 29 04:02:05 2008 +0900
+++ b/src/mule-coding.c Wed Oct 29 04:06:33 2008 +0900
@@ -3339,7 +3339,7 @@ ccl_putprop (Lisp_Object codesys, Lisp_O
{
Lisp_Object sym;
struct ccl_program test_ccl;
- Ascbyte *suffix;
+ const Ascbyte *suffix;
/* Check key first. */
if (EQ (key, Qdecode))
diff -r 03ba50f7ecd7fb0dee997f30f1f1b7af746c7493 -r 726060ee587c536ac95384a055029092ea091231 src/print.c
--- a/src/print.c Wed Oct 29 04:02:05 2008 +0900
+++ b/src/print.c Wed Oct 29 04:06:33 2008 +0900
@@ -1527,7 +1527,7 @@ enum printing_badness
static void
printing_major_badness (Lisp_Object printcharfun,
- Ascbyte *badness_string, int type, void *val,
+ const Ascbyte *badness_string, int type, void *val,
enum printing_badness badness)
{
Ibyte buf[666];
diff -r 03ba50f7ecd7fb0dee997f30f1f1b7af746c7493 -r 726060ee587c536ac95384a055029092ea091231 src/redisplay.c
--- a/src/redisplay.c Wed Oct 29 04:02:05 2008 +0900
+++ b/src/redisplay.c Wed Oct 29 04:06:33 2008 +0900
@@ -4447,7 +4447,7 @@ tail_recurse:
{
invalid:
{
- char *str = GETTEXT ("*invalid*");
+ const char *str = GETTEXT ("*invalid*");
Charcount size = (Charcount) strlen (str); /* is this ok ?? -- dv */
if (size <= *offset)
diff -r 03ba50f7ecd7fb0dee997f30f1f1b7af746c7493 -r 726060ee587c536ac95384a055029092ea091231 lwlib/xt-wrappers.h
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/lwlib/xt-wrappers.h Wed Oct 29 04:06:33 2008 +0900
@@ -0,0 +1,103 @@
+/* Wrappers for Xt functions and macros
+
+ Copyright (C) 2008 Free Software Foundation
+
+This file is part of XEmacs.
+
+XEmacs is free software; you can redistribute it and/or modify it
+under the terms of the GNU General Public License as published by the
+Free Software Foundation; either version 2, or (at your option) any
+later version.
+
+XEmacs is distributed in the hope that it will be useful, but WITHOUT
+ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+for more details.
+You should have received a copy of the GNU General Public License
+along with XEmacs; see the file COPYING. If not, write to
+the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+Boston, MA 02111-1307, USA. */
+
+/* Synched up with: Not in FSF. */
+
+/* Original author: Stephen J. Turnbull for 21.5.29 */
+
+/* Generic utility macros, including coping with G++ whining.
+ Used in lwlib via lwlib.h and X consoles via console-x.h.
+
+ We would prefer to find another way to shut up G++. The issue is that
+ recent versions of the C++ standard deprecate implicit conversions
+ across function boundaries like
+
+ typedef char *String;
+ void foo (String string);
+ foo ("bar");
+
+ because "bar" should be allowed to be a read-only array of chars. But of
+ course lots of legacy code (== X11) declares things as char * and expects
+ to assign literal strings to them. Now, the typedef in the example is
+ important because in G++ 4.3.2 at least, this
+
+ void foo (const String string);
+ foo ("bar");
+
+ does not work as expected! G++ still warns about this construct. However,
+ if foo is declared
+
+ void foo (const char *string);
+
+ G++ does not complain. (#### There are two possibilities I can think of.
+ (a) G++ is buggy. (b) "const String" is interpreted as "char * const".)
+
+ The upshot is that to avoid warnings with Xt's String typedef, we need to
+ arrange to cast literal strings to String, rather than use "const String"
+ in declarations. (My <X11/Intrinsic.h> says that the actual internal
+ typedef used is _XtString, so that String can be #define'd to something
+ else for the purposes of C++. But that doesn't really help us much.)
+
+ It's not very satisfactory to do it this way -- it would be much better to
+ have const Strings where they make sense -- but it does eliminate a few
+ hundred warnings from the C++ build. And in any case we don't control the
+ many objects declared with String components in Intrinsic.h. The remaining
+ issues are the WEXTTEXT macro used in src/emacs.c, and Emacs.ad.h (where
+ instead of String we use const char * in src/event-Xt.c in the array that
+ #includes it).
+*/
+
+#ifndef INCLUDED_xt_wrappers_h_
+#define INCLUDED_xt_wrappers_h_
+
+/* Wrap XtResource, with the same elements as arguments.
+ The cast to String shuts up G++ 4.3's whining about const char *.
+ The invocation of sizeof should be pretty safe, and the cast to XtPointer
+ surely is, since that's how that member of XtResource is declared. It
+ doesn't hide potential problems, because XtPointer is a "generic" type in
+ any case -- the actual object will have a different type, that will be
+ cast to XtPointer. */
+
+#define Xt_RESOURCE(name,_class,intrepr,type,member,extrepr,value) \
+ { (String) name, (String) _class, (String) intrepr, sizeof(type), \
+ member, extrepr, (XtPointer) value }
+
+/* Wrap XtSetArg, with the same arguments.
+ The cast to String shuts up G++ 4.3's whining about const char *. */
+
+#define Xt_SET_ARG(al, resource, x) do { \
+ XtSetArg ((al), (String) (resource), (x)); \
+ } while (0)
+
+/* Convenience macros for getting/setting one resource value. */
+
+#define Xt_SET_VALUE(widget, resource, value) do { \
+ Arg al; \
+ Xt_SET_ARG (al, resource, value); \
+ XtSetValues (widget, &al, 1); \
+} while (0)
+
+#define Xt_GET_VALUE(widget, resource, location) do { \
+ Arg al; \
+ Xt_SET_ARG (al, resource, location); \
+ XtGetValues (widget, &al, 1); \
+} while (0)
+
+#endif /* INCLUDED_xt_wrappers_h_ */
_______________________________________________
XEmacs-Patches mailing list
XEmacs-Patches(a)xemacs.org
http://calypso.tux.org/cgi-bin/mailman/listinfo/xemacs-patches
carbon2-commit: Fix at_dot regex under Mule. <87hc6rv53v.fsf@uwakimon.sk.tsukuba.ac.jp>
16 years, 1 month
Aidan Kehoe
changeset: 4562:8418d1ad49444db104dd28923211ed61c77115ba
user: Stephen J. Turnbull <stephen(a)xemacs.org>
date: Sun Nov 02 00:34:13 2008 +0900
files: src/ChangeLog src/regex.c
description:
Fix at_dot regex under Mule. <87hc6rv53v.fsf(a)uwakimon.sk.tsukuba.ac.jp>
diff -r 38493c0fb95276095275de9f45dda634a7cb8ca6 -r 8418d1ad49444db104dd28923211ed61c77115ba src/ChangeLog
--- a/src/ChangeLog Sun Nov 02 00:12:13 2008 +0900
+++ b/src/ChangeLog Sun Nov 02 00:34:13 2008 +0900
@@ -1,3 +1,8 @@ 2008-11-01 Stephen J. Turnbull <stephe
+2008-11-01 Stephen J. Turnbull <stephen(a)xemacs.org>
+
+ * regex.c (re_search_2): Fix at_dot by changing charpos to bytepos.
+ From Julian Bradfield <18654.1143.304851.782755(a)krk.inf.ed.ac.uk>.
+
2008-11-01 Stephen J. Turnbull <stephen(a)xemacs.org>
* mule-ccl.c (ccl_driver): Fix off-by-one error.
diff -r 38493c0fb95276095275de9f45dda634a7cb8ca6 -r 8418d1ad49444db104dd28923211ed61c77115ba src/regex.c
--- a/src/regex.c Sun Nov 02 00:12:13 2008 +0900
+++ b/src/regex.c Sun Nov 02 00:34:13 2008 +0900
@@ -4313,8 +4313,8 @@ re_search_2 (struct re_pattern_buffer *b
{
if (!BUFFERP (lispobj))
return -1;
- range = (BUF_PT (XBUFFER (lispobj)) - BUF_BEGV (XBUFFER (lispobj))
- - startpos);
+ range = (BYTE_BUF_PT (XBUFFER (lispobj))
+ - BYTE_BUF_BEGV (XBUFFER (lispobj)) - startpos);
if (range < 0)
return -1;
}
_______________________________________________
XEmacs-Patches mailing list
XEmacs-Patches(a)xemacs.org
http://calypso.tux.org/cgi-bin/mailman/listinfo/xemacs-patches
carbon2-commit: Fix accidental deletion in src/text.c.
16 years, 1 month
Aidan Kehoe
changeset: 4561:38493c0fb95276095275de9f45dda634a7cb8ca6
user: Stephen J. Turnbull <stephen(a)xemacs.org>
date: Sun Nov 02 00:12:13 2008 +0900
files: src/text.c
description:
Fix accidental deletion in src/text.c.
diff -r d64f1060cd6503ad009f196304b241f940a0fe23 -r 38493c0fb95276095275de9f45dda634a7cb8ca6 src/text.c
--- a/src/text.c Sat Nov 01 23:32:53 2008 +0900
+++ b/src/text.c Sun Nov 02 00:12:13 2008 +0900
@@ -3018,7 +3018,7 @@ bytebpos_to_charbpos_func (struct buffer
int record = x - best_below_byte > 5000;
#ifdef OLD_LOOP /* old code */
- (best_below_byte < x)
+ while (best_below_byte < x)
{
best_below++;
INC_BYTEBPOS (buf, best_below_byte);
_______________________________________________
XEmacs-Patches mailing list
XEmacs-Patches(a)xemacs.org
http://calypso.tux.org/cgi-bin/mailman/listinfo/xemacs-patches
carbon2-commit: Fix off-by-one error in ccl_driver. <87iqr7v7p0.fsf@uwakimon.sk.tsukuba.ac.jp>
16 years, 1 month
Aidan Kehoe
changeset: 4560:d64f1060cd6503ad009f196304b241f940a0fe23
user: Stephen J. Turnbull <stephen(a)xemacs.org>
date: Sat Nov 01 23:32:53 2008 +0900
files: src/ChangeLog src/mule-ccl.c src/text.c
description:
Fix off-by-one error in ccl_driver. <87iqr7v7p0.fsf(a)uwakimon.sk.tsukuba.ac.jp>
diff -r 03ba50f7ecd7fb0dee997f30f1f1b7af746c7493 -r d64f1060cd6503ad009f196304b241f940a0fe23 src/ChangeLog
--- a/src/ChangeLog Wed Oct 29 04:02:05 2008 +0900
+++ b/src/ChangeLog Sat Nov 01 23:32:53 2008 +0900
@@ -1,3 +1,8 @@ 2008-10-25 Stephen J. Turnbull <stephe
+2008-11-01 Stephen J. Turnbull <stephen(a)xemacs.org>
+
+ * mule-ccl.c (ccl_driver): Fix off-by-one error.
+ By Julian Bradfield in <18691.16568.526264.972026(a)krk.inf.ed.ac.uk>.
+
2008-10-25 Stephen J. Turnbull <stephen(a)xemacs.org>
* lisp.h (static_pro): Cast out a warning.
diff -r 03ba50f7ecd7fb0dee997f30f1f1b7af746c7493 -r d64f1060cd6503ad009f196304b241f940a0fe23 src/mule-ccl.c
--- a/src/mule-ccl.c Wed Oct 29 04:02:05 2008 +0900
+++ b/src/mule-ccl.c Sat Nov 01 23:32:53 2008 +0900
@@ -1455,7 +1455,7 @@ ccl_driver (struct ccl_program *ccl,
if (XCHARSET_DIMENSION (charset_by_leading_byte (i)) == 1)
i = (((i - FIELD2_TO_OFFICIAL_LEADING_BYTE) << 7)
| (reg[rrr] & 0x7F));
- else if (i < MAX_LEADING_BYTE_OFFICIAL_2)
+ else if (i <= MAX_LEADING_BYTE_OFFICIAL_2)
i = ((i - FIELD1_TO_OFFICIAL_LEADING_BYTE) << 14)
| reg[rrr];
else
diff -r 03ba50f7ecd7fb0dee997f30f1f1b7af746c7493 -r d64f1060cd6503ad009f196304b241f940a0fe23 src/text.c
--- a/src/text.c Wed Oct 29 04:02:05 2008 +0900
+++ b/src/text.c Sat Nov 01 23:32:53 2008 +0900
@@ -3018,7 +3018,7 @@ bytebpos_to_charbpos_func (struct buffer
int record = x - best_below_byte > 5000;
#ifdef OLD_LOOP /* old code */
- while (best_below_byte < x)
+ (best_below_byte < x)
{
best_below++;
INC_BYTEBPOS (buf, best_below_byte);
_______________________________________________
XEmacs-Patches mailing list
XEmacs-Patches(a)xemacs.org
http://calypso.tux.org/cgi-bin/mailman/listinfo/xemacs-patches