Mercurial > hg > xemacs-beta
comparison src/ui-byhand.c @ 5581:56144c8593a8
Mechanically change INT to FIXNUM in our sources.
src/ChangeLog addition:
2011-10-09 Aidan Kehoe <kehoea@parhasard.net>
[...]
Mechanically change INT (where it refers to non-bignum Lisp
integers) to FIXNUM in our sources. Done for the following
functions, enums, and macros: Lisp_Type_Int_Even,
Lisp_Type_Int_Odd, INT_GCBITS, INT_VALBITS, make_int(), INTP(),
XINT(), CHECK_INT(), XREALINT(), INT_PLUS(), INT_MINUS(),
EMACS_INT_MAX (to MOST_POSITIVE_FIXNUM), EMACS_INT_MIN (to
MOST_NEGATIVE_FIXNUM), NUMBER_FITS_IN_AN_EMACS_INT() to
NUMBER_FITS_IN_A_FIXNUM(), XFLOATINT, XCHAR_OR_INT, INT_OR_FLOAT.
The EMACS_INT typedef was not changed, it does not describe
non-bignum Lisp integers.
Script that did the change available in
http://mid.gmane.org/20067.17650.181273.12014@parhasard.net .
modules/ChangeLog addition:
2011-10-09 Aidan Kehoe <kehoea@parhasard.net>
[...]
Mechanically change INT to FIXNUM, where the usage describes non-bignum
Lisp integers. See the src/ChangeLog entry for more details.
man/ChangeLog addition:
2011-10-09 Aidan Kehoe <kehoea@parhasard.net>
* internals/internals.texi (How Lisp Objects Are Represented in C):
* internals/internals.texi (Integers and Characters):
Mechanically change INT to FIXNUM, where the usage describes non-bignum
Lisp integers.
author | Aidan Kehoe <kehoea@parhasard.net> |
---|---|
date | Sun, 09 Oct 2011 09:51:57 +0100 |
parents | b9167d522a9a |
children |
comparison
equal
deleted
inserted
replaced
5580:a0e81357194e | 5581:56144c8593a8 |
---|---|
55 | 55 |
56 gtk_box_query_child_packing (GTK_BOX (XGTK_OBJECT (box)->object), | 56 gtk_box_query_child_packing (GTK_BOX (XGTK_OBJECT (box)->object), |
57 GTK_WIDGET (XGTK_OBJECT (child)->object), | 57 GTK_WIDGET (XGTK_OBJECT (child)->object), |
58 &expand, &fill, &padding, &pack_type); | 58 &expand, &fill, &padding, &pack_type); |
59 | 59 |
60 result = Fcons (make_int (pack_type), result); | 60 result = Fcons (make_fixnum (pack_type), result); |
61 result = Fcons (make_int (padding), result); | 61 result = Fcons (make_fixnum (padding), result); |
62 result = Fcons (fill ? Qt : Qnil, result); | 62 result = Fcons (fill ? Qt : Qnil, result); |
63 result = Fcons (expand ? Qt : Qnil, result); | 63 result = Fcons (expand ? Qt : Qnil, result); |
64 | 64 |
65 return (result); | 65 return (result); |
66 } | 66 } |
74 { | 74 { |
75 gint width, height; | 75 gint width, height; |
76 | 76 |
77 gtk_button_box_get_child_size_default (&width, &height); | 77 gtk_button_box_get_child_size_default (&width, &height); |
78 | 78 |
79 return (Fcons (make_int (width), make_int (height))); | 79 return (Fcons (make_fixnum (width), make_fixnum (height))); |
80 } | 80 } |
81 | 81 |
82 /* void gtk_button_box_get_child_ipadding_default (gint *ipad_x, gint *ipad_y); */ | 82 /* void gtk_button_box_get_child_ipadding_default (gint *ipad_x, gint *ipad_y); */ |
83 DEFUN ("gtk-button-box-get-child-ipadding-default", | 83 DEFUN ("gtk-button-box-get-child-ipadding-default", |
84 Fgtk_button_box_get_child_ipadding_default, 0, 0, 0, /* | 84 Fgtk_button_box_get_child_ipadding_default, 0, 0, 0, /* |
88 { | 88 { |
89 gint x, y; | 89 gint x, y; |
90 | 90 |
91 gtk_button_box_get_child_ipadding_default (&x, &y); | 91 gtk_button_box_get_child_ipadding_default (&x, &y); |
92 | 92 |
93 return (Fcons (make_int (x), make_int (y))); | 93 return (Fcons (make_fixnum (x), make_fixnum (y))); |
94 } | 94 } |
95 | 95 |
96 /* void gtk_button_box_get_child_size (GtkButtonBox *widget, | 96 /* void gtk_button_box_get_child_size (GtkButtonBox *widget, |
97 gint *min_width, gint *min_height); */ | 97 gint *min_width, gint *min_height); */ |
98 DEFUN ("gtk-button-box-get-child-size", Fgtk_button_box_get_child_size, 1, 1, 0, /* | 98 DEFUN ("gtk-button-box-get-child-size", Fgtk_button_box_get_child_size, 1, 1, 0, /* |
110 } | 110 } |
111 | 111 |
112 gtk_button_box_get_child_size (GTK_BUTTON_BOX (XGTK_OBJECT (box)->object), | 112 gtk_button_box_get_child_size (GTK_BUTTON_BOX (XGTK_OBJECT (box)->object), |
113 &width, &height); | 113 &width, &height); |
114 | 114 |
115 return (Fcons (make_int (width), make_int (height))); | 115 return (Fcons (make_fixnum (width), make_fixnum (height))); |
116 } | 116 } |
117 | 117 |
118 /* void gtk_button_box_get_child_ipadding (GtkButtonBox *widget, gint *ipad_x, gint *ipad_y); */ | 118 /* void gtk_button_box_get_child_ipadding (GtkButtonBox *widget, gint *ipad_x, gint *ipad_y); */ |
119 DEFUN ("gtk-button-box-get-child-ipadding", | 119 DEFUN ("gtk-button-box-get-child-ipadding", |
120 Fgtk_button_box_get_child_ipadding, 1, 1, 0, /* | 120 Fgtk_button_box_get_child_ipadding, 1, 1, 0, /* |
132 } | 132 } |
133 | 133 |
134 gtk_button_box_get_child_ipadding (GTK_BUTTON_BOX (XGTK_OBJECT (box)->object), | 134 gtk_button_box_get_child_ipadding (GTK_BUTTON_BOX (XGTK_OBJECT (box)->object), |
135 &x, &y); | 135 &x, &y); |
136 | 136 |
137 return (Fcons (make_int (x), make_int (y))); | 137 return (Fcons (make_fixnum (x), make_fixnum (y))); |
138 } | 138 } |
139 | 139 |
140 /*void gtk_calendar_get_date (GtkCalendar *calendar, | 140 /*void gtk_calendar_get_date (GtkCalendar *calendar, |
141 guint *year, | 141 guint *year, |
142 guint *month, | 142 guint *month, |
157 } | 157 } |
158 | 158 |
159 gtk_calendar_get_date (GTK_CALENDAR (XGTK_OBJECT (calendar)->object), | 159 gtk_calendar_get_date (GTK_CALENDAR (XGTK_OBJECT (calendar)->object), |
160 &year, &month, &day); | 160 &year, &month, &day); |
161 | 161 |
162 return (list3 (make_int (year), make_int (month), make_int (day))); | 162 return (list3 (make_fixnum (year), make_fixnum (month), make_fixnum (day))); |
163 } | 163 } |
164 | 164 |
165 /* gint gtk_clist_get_text (GtkCList *clist, | 165 /* gint gtk_clist_get_text (GtkCList *clist, |
166 gint row, | 166 gint row, |
167 gint column, | 167 gint column, |
174 { | 174 { |
175 gchar *text = NULL; | 175 gchar *text = NULL; |
176 Lisp_Object rval = Qnil; | 176 Lisp_Object rval = Qnil; |
177 | 177 |
178 CHECK_GTK_OBJECT (obj); | 178 CHECK_GTK_OBJECT (obj); |
179 CHECK_INT (row); | 179 CHECK_FIXNUM (row); |
180 CHECK_INT (column); | 180 CHECK_FIXNUM (column); |
181 | 181 |
182 if (!GTK_IS_CLIST (XGTK_OBJECT (obj)->object)) | 182 if (!GTK_IS_CLIST (XGTK_OBJECT (obj)->object)) |
183 { | 183 { |
184 wtaerror ("Object is not a GtkCList", obj); | 184 wtaerror ("Object is not a GtkCList", obj); |
185 } | 185 } |
186 | 186 |
187 gtk_clist_get_text (GTK_CLIST (XGTK_OBJECT (obj)->object), XINT (row), XINT (column), &text); | 187 gtk_clist_get_text (GTK_CLIST (XGTK_OBJECT (obj)->object), XFIXNUM (row), XFIXNUM (column), &text); |
188 | 188 |
189 if (text) | 189 if (text) |
190 { | 190 { |
191 rval = build_cistring (text); | 191 rval = build_cistring (text); |
192 /* NOTE: This is NOT a memory leak. GtkCList returns a pointer | 192 /* NOTE: This is NOT a memory leak. GtkCList returns a pointer |
209 (obj, x, y)) | 209 (obj, x, y)) |
210 { | 210 { |
211 gint row, column; | 211 gint row, column; |
212 | 212 |
213 CHECK_GTK_OBJECT (obj); | 213 CHECK_GTK_OBJECT (obj); |
214 CHECK_INT (x); | 214 CHECK_FIXNUM (x); |
215 CHECK_INT (y); | 215 CHECK_FIXNUM (y); |
216 | 216 |
217 if (!GTK_IS_CLIST (XGTK_OBJECT (obj)->object)) | 217 if (!GTK_IS_CLIST (XGTK_OBJECT (obj)->object)) |
218 { | 218 { |
219 wtaerror ("Object is not a GtkCList", obj); | 219 wtaerror ("Object is not a GtkCList", obj); |
220 } | 220 } |
221 | 221 |
222 gtk_clist_get_selection_info (GTK_CLIST (XGTK_OBJECT (obj)->object), | 222 gtk_clist_get_selection_info (GTK_CLIST (XGTK_OBJECT (obj)->object), |
223 XINT (x), XINT (y), &row, &column); | 223 XFIXNUM (x), XFIXNUM (y), &row, &column); |
224 | 224 |
225 return (Fcons (make_int (row), make_int (column))); | 225 return (Fcons (make_fixnum (row), make_fixnum (column))); |
226 } | 226 } |
227 | 227 |
228 DEFUN ("gtk-clist-get-pixmap", Fgtk_clist_get_pixmap, 3, 3, 0, /* | 228 DEFUN ("gtk-clist-get-pixmap", Fgtk_clist_get_pixmap, 3, 3, 0, /* |
229 Return a cons of (pixmap . mask) at ROW,COLUMN in CLIST. | 229 Return a cons of (pixmap . mask) at ROW,COLUMN in CLIST. |
230 */ | 230 */ |
232 { | 232 { |
233 GdkPixmap *pixmap = NULL; | 233 GdkPixmap *pixmap = NULL; |
234 GdkBitmap *mask = NULL; | 234 GdkBitmap *mask = NULL; |
235 | 235 |
236 CHECK_GTK_OBJECT (clist); | 236 CHECK_GTK_OBJECT (clist); |
237 CHECK_INT (row); | 237 CHECK_FIXNUM (row); |
238 CHECK_INT (column); | 238 CHECK_FIXNUM (column); |
239 | 239 |
240 if (!GTK_IS_CLIST (XGTK_OBJECT (clist)->object)) | 240 if (!GTK_IS_CLIST (XGTK_OBJECT (clist)->object)) |
241 { | 241 { |
242 wtaerror ("Object is not a GtkCList", clist); | 242 wtaerror ("Object is not a GtkCList", clist); |
243 } | 243 } |
244 | 244 |
245 gtk_clist_get_pixmap (GTK_CLIST (XGTK_OBJECT (clist)->object), | 245 gtk_clist_get_pixmap (GTK_CLIST (XGTK_OBJECT (clist)->object), |
246 XINT (row), XINT (column), | 246 XFIXNUM (row), XFIXNUM (column), |
247 &pixmap, &mask); | 247 &pixmap, &mask); |
248 | 248 |
249 return (Fcons (pixmap ? build_gtk_boxed (pixmap, GTK_TYPE_GDK_WINDOW) : Qnil, | 249 return (Fcons (pixmap ? build_gtk_boxed (pixmap, GTK_TYPE_GDK_WINDOW) : Qnil, |
250 mask ? build_gtk_boxed (mask, GTK_TYPE_GDK_WINDOW) : Qnil)); | 250 mask ? build_gtk_boxed (mask, GTK_TYPE_GDK_WINDOW) : Qnil)); |
251 } | 251 } |
259 GdkBitmap *mask = NULL; | 259 GdkBitmap *mask = NULL; |
260 char *text = NULL; | 260 char *text = NULL; |
261 guint8 spacing; | 261 guint8 spacing; |
262 | 262 |
263 CHECK_GTK_OBJECT (clist); | 263 CHECK_GTK_OBJECT (clist); |
264 CHECK_INT (row); | 264 CHECK_FIXNUM (row); |
265 CHECK_INT (column); | 265 CHECK_FIXNUM (column); |
266 | 266 |
267 if (!GTK_IS_CLIST (XGTK_OBJECT (clist)->object)) | 267 if (!GTK_IS_CLIST (XGTK_OBJECT (clist)->object)) |
268 { | 268 { |
269 wtaerror ("Object is not a GtkCList", clist); | 269 wtaerror ("Object is not a GtkCList", clist); |
270 } | 270 } |
271 | 271 |
272 gtk_clist_get_pixtext (GTK_CLIST (XGTK_OBJECT (clist)->object), | 272 gtk_clist_get_pixtext (GTK_CLIST (XGTK_OBJECT (clist)->object), |
273 XINT (row), XINT (column), &text, &spacing, | 273 XFIXNUM (row), XFIXNUM (column), &text, &spacing, |
274 &pixmap, &mask); | 274 &pixmap, &mask); |
275 | 275 |
276 return (list3 (pixmap ? build_gtk_boxed (pixmap, GTK_TYPE_GDK_WINDOW) : Qnil, | 276 return (list3 (pixmap ? build_gtk_boxed (pixmap, GTK_TYPE_GDK_WINDOW) : Qnil, |
277 mask ? build_gtk_boxed (mask, GTK_TYPE_GDK_WINDOW) : Qnil, | 277 mask ? build_gtk_boxed (mask, GTK_TYPE_GDK_WINDOW) : Qnil, |
278 (text && text[0]) ? build_cistring (text) : Qnil)); | 278 (text && text[0]) ? build_cistring (text) : Qnil)); |
310 { | 310 { |
311 gint the_pos; | 311 gint the_pos; |
312 | 312 |
313 CHECK_GTK_OBJECT (obj); | 313 CHECK_GTK_OBJECT (obj); |
314 CHECK_STRING (string); | 314 CHECK_STRING (string); |
315 CHECK_INT (pos); | 315 CHECK_FIXNUM (pos); |
316 | 316 |
317 the_pos = XINT (pos); | 317 the_pos = XFIXNUM (pos); |
318 | 318 |
319 if (!GTK_IS_EDITABLE (XGTK_OBJECT (obj)->object)) | 319 if (!GTK_IS_EDITABLE (XGTK_OBJECT (obj)->object)) |
320 { | 320 { |
321 wtaerror ("Object is not a GtkEditable", obj); | 321 wtaerror ("Object is not a GtkEditable", obj); |
322 } | 322 } |
324 gtk_editable_insert_text (GTK_EDITABLE (XGTK_OBJECT (obj)->object), | 324 gtk_editable_insert_text (GTK_EDITABLE (XGTK_OBJECT (obj)->object), |
325 (char *) XSTRING_DATA (string), | 325 (char *) XSTRING_DATA (string), |
326 XSTRING_LENGTH (string), | 326 XSTRING_LENGTH (string), |
327 &the_pos); | 327 &the_pos); |
328 | 328 |
329 return (make_int (the_pos)); | 329 return (make_fixnum (the_pos)); |
330 } | 330 } |
331 | 331 |
332 DEFUN ("gtk-pixmap-get", Fgtk_pixmap_get, 1, 1, 0, /* | 332 DEFUN ("gtk-pixmap-get", Fgtk_pixmap_get, 1, 1, 0, /* |
333 Return a cons cell of (PIXMAP . MASK) from GtkPixmap OBJECT. | 333 Return a cons cell of (PIXMAP . MASK) from GtkPixmap OBJECT. |
334 */ | 334 */ |
357 gfloat *vector = NULL; | 357 gfloat *vector = NULL; |
358 Lisp_Object lisp_vector = Qnil; | 358 Lisp_Object lisp_vector = Qnil; |
359 int i; | 359 int i; |
360 | 360 |
361 CHECK_GTK_OBJECT (curve); | 361 CHECK_GTK_OBJECT (curve); |
362 CHECK_INT (length); | 362 CHECK_FIXNUM (length); |
363 | 363 |
364 if (!GTK_IS_CURVE (XGTK_OBJECT (curve)->object)) | 364 if (!GTK_IS_CURVE (XGTK_OBJECT (curve)->object)) |
365 { | 365 { |
366 wtaerror ("Object is not a GtkCurve", curve); | 366 wtaerror ("Object is not a GtkCurve", curve); |
367 } | 367 } |
368 | 368 |
369 vector = alloca_array (gfloat, XINT (length)); | 369 vector = alloca_array (gfloat, XFIXNUM (length)); |
370 | 370 |
371 gtk_curve_get_vector (GTK_CURVE (XGTK_OBJECT (curve)->object), XINT (length), vector); | 371 gtk_curve_get_vector (GTK_CURVE (XGTK_OBJECT (curve)->object), XFIXNUM (length), vector); |
372 lisp_vector = make_vector (XINT (length), Qnil); | 372 lisp_vector = make_vector (XFIXNUM (length), Qnil); |
373 | 373 |
374 for (i = 0; i < XINT (length); i++) | 374 for (i = 0; i < XFIXNUM (length); i++) |
375 { | 375 { |
376 XVECTOR_DATA (lisp_vector)[i] = make_float (vector[i]); | 376 XVECTOR_DATA (lisp_vector)[i] = make_float (vector[i]); |
377 } | 377 } |
378 | 378 |
379 return (lisp_vector); | 379 return (lisp_vector); |
452 | 452 |
453 gtk_notebook_query_tab_label_packing (GTK_NOTEBOOK (XGTK_OBJECT (notebook)->object), | 453 gtk_notebook_query_tab_label_packing (GTK_NOTEBOOK (XGTK_OBJECT (notebook)->object), |
454 GTK_WIDGET (XGTK_OBJECT (child)->object), | 454 GTK_WIDGET (XGTK_OBJECT (child)->object), |
455 &expand, &fill, &pack_type); | 455 &expand, &fill, &pack_type); |
456 | 456 |
457 return (list3 (expand ? Qt : Qnil, fill ? Qt : Qnil, make_int (pack_type))); | 457 return (list3 (expand ? Qt : Qnil, fill ? Qt : Qnil, make_fixnum (pack_type))); |
458 } | 458 } |
459 | 459 |
460 DEFUN ("gtk-widget-get-pointer", Fgtk_widget_get_pointer, 1, 1, 0, /* | 460 DEFUN ("gtk-widget-get-pointer", Fgtk_widget_get_pointer, 1, 1, 0, /* |
461 Return the pointer position relative to WIDGET as a cons of (X . Y). | 461 Return the pointer position relative to WIDGET as a cons of (X . Y). |
462 */ | 462 */ |
470 wtaerror ("Object is not a GtkWidget", widget); | 470 wtaerror ("Object is not a GtkWidget", widget); |
471 } | 471 } |
472 | 472 |
473 gtk_widget_get_pointer (GTK_WIDGET (XGTK_OBJECT (widget)->object), &x, &y); | 473 gtk_widget_get_pointer (GTK_WIDGET (XGTK_OBJECT (widget)->object), &x, &y); |
474 | 474 |
475 return (Fcons (make_int (x), make_int (y))); | 475 return (Fcons (make_fixnum (x), make_fixnum (y))); |
476 } | 476 } |
477 | 477 |
478 /* This is called whenever an item with a GUI_ID associated with it is | 478 /* This is called whenever an item with a GUI_ID associated with it is |
479 destroyed. This allows us to remove the references in gui-gtk.c | 479 destroyed. This allows us to remove the references in gui-gtk.c |
480 that made sure callbacks and such were GCPRO-ed | 480 that made sure callbacks and such were GCPRO-ed |
559 (char*) XSTRING_DATA (tooltip_text), | 559 (char*) XSTRING_DATA (tooltip_text), |
560 (char*) XSTRING_DATA (tooltip_private_text), | 560 (char*) XSTRING_DATA (tooltip_private_text), |
561 GTK_WIDGET (XGTK_OBJECT (icon)->object), | 561 GTK_WIDGET (XGTK_OBJECT (icon)->object), |
562 GTK_SIGNAL_FUNC (__generic_toolbar_callback), | 562 GTK_SIGNAL_FUNC (__generic_toolbar_callback), |
563 STORE_LISP_IN_VOID (callback), | 563 STORE_LISP_IN_VOID (callback), |
564 XINT (position)); | 564 XFIXNUM (position)); |
565 } | 565 } |
566 | 566 |
567 | 567 |
568 return (w ? build_gtk_object (GTK_OBJECT (w)) : Qnil); | 568 return (w ? build_gtk_object (GTK_OBJECT (w)) : Qnil); |
569 } | 569 } |
587 DEFUN ("gtk-toolbar-insert-item", Fgtk_toolbar_insert_item, 7, 8, 0, /* | 587 DEFUN ("gtk-toolbar-insert-item", Fgtk_toolbar_insert_item, 7, 8, 0, /* |
588 Adds a new button to the beginning (left or top edges) of the given toolbar. | 588 Adds a new button to the beginning (left or top edges) of the given toolbar. |
589 */ | 589 */ |
590 (toolbar, text, tooltip_text, tooltip_private_text, icon, callback, position, data)) | 590 (toolbar, text, tooltip_text, tooltip_private_text, icon, callback, position, data)) |
591 { | 591 { |
592 CHECK_INT (position); | 592 CHECK_FIXNUM (position); |
593 | 593 |
594 return (generic_toolbar_insert_item (toolbar,text,tooltip_text,tooltip_private_text,icon,callback,data,Qnil,position)); | 594 return (generic_toolbar_insert_item (toolbar,text,tooltip_text,tooltip_private_text,icon,callback,data,Qnil,position)); |
595 } | 595 } |
596 | 596 |
597 /* GtkCTree is an abomination in the eyes of the object system. */ | 597 /* GtkCTree is an abomination in the eyes of the object system. */ |
652 CHECK_GTK_BOXED (node); | 652 CHECK_GTK_BOXED (node); |
653 } | 653 } |
654 | 654 |
655 if (!NILP (depth)) | 655 if (!NILP (depth)) |
656 { | 656 { |
657 CHECK_INT (depth); | 657 CHECK_FIXNUM (depth); |
658 } | 658 } |
659 | 659 |
660 closure = Fcons (func, data); | 660 closure = Fcons (func, data); |
661 | 661 |
662 GCPRO3 (ctree, node, closure); | 662 GCPRO3 (ctree, node, closure); |
672 else | 672 else |
673 { | 673 { |
674 (NILP (childfirstp) ? gtk_ctree_post_recursive_to_depth : gtk_ctree_pre_recursive_to_depth) | 674 (NILP (childfirstp) ? gtk_ctree_post_recursive_to_depth : gtk_ctree_pre_recursive_to_depth) |
675 (GTK_CTREE (XGTK_OBJECT (ctree)->object), | 675 (GTK_CTREE (XGTK_OBJECT (ctree)->object), |
676 NILP (node) ? NULL : (GtkCTreeNode *) XGTK_BOXED (node)->object, | 676 NILP (node) ? NULL : (GtkCTreeNode *) XGTK_BOXED (node)->object, |
677 XINT (depth), | 677 XFIXNUM (depth), |
678 __emacs_gtk_ctree_recurse_internal, | 678 __emacs_gtk_ctree_recurse_internal, |
679 STORE_LISP_IN_VOID (closure)); | 679 STORE_LISP_IN_VOID (closure)); |
680 } | 680 } |
681 | 681 |
682 UNGCPRO; | 682 UNGCPRO; |