Mercurial > hg > xemacs-beta
comparison src/dialog-msw.c @ 647:b39c14581166
[xemacs-hg @ 2001-08-13 04:45:47 by ben]
removal of unsigned, size_t, etc.
author | ben |
---|---|
date | Mon, 13 Aug 2001 04:46:48 +0000 |
parents | af57a77cbc92 |
children | fdefd0186b75 |
comparison
equal
deleted
inserted
replaced
646:00c54252fe4f | 647:b39c14581166 |
---|---|
205 VOID_TO_LISP (data, GetWindowLong (hwnd, DWL_USER)); | 205 VOID_TO_LISP (data, GetWindowLong (hwnd, DWL_USER)); |
206 did = XMSWINDOWS_DIALOG_ID (data); | 206 did = XMSWINDOWS_DIALOG_ID (data); |
207 if (w_param != IDCANCEL) /* user pressed escape */ | 207 if (w_param != IDCANCEL) /* user pressed escape */ |
208 { | 208 { |
209 assert (w_param >= ID_ITEM_BIAS | 209 assert (w_param >= ID_ITEM_BIAS |
210 && w_param | 210 && (EMACS_INT) w_param |
211 < XVECTOR_LENGTH (did->callbacks) + ID_ITEM_BIAS); | 211 < XVECTOR_LENGTH (did->callbacks) + ID_ITEM_BIAS); |
212 | 212 |
213 get_gui_callback (XVECTOR_DATA (did->callbacks) | 213 get_gui_callback (XVECTOR_DATA (did->callbacks) |
214 [w_param - ID_ITEM_BIAS], | 214 [w_param - ID_ITEM_BIAS], |
215 &fn, &arg); | 215 &fn, &arg); |
268 uni_string, sizeof(WCHAR) * (length + 1)); | 268 uni_string, sizeof(WCHAR) * (length + 1)); |
269 Dynarr_add_many (dynarr, uni_string, sizeof(WCHAR) * length); | 269 Dynarr_add_many (dynarr, uni_string, sizeof(WCHAR) * length); |
270 } | 270 } |
271 | 271 |
272 /* Given button TEXT, return button width in DLU */ | 272 /* Given button TEXT, return button width in DLU */ |
273 static unsigned int | 273 static int |
274 button_width (Lisp_Object text) | 274 button_width (Lisp_Object text) |
275 { | 275 { |
276 unsigned int width = X_DLU_PER_CHAR * XSTRING_CHAR_LENGTH (text); | 276 int width = X_DLU_PER_CHAR * XSTRING_CHAR_LENGTH (text); |
277 return max (X_MIN_BUTTON, width); | 277 return max (X_MIN_BUTTON, width); |
278 } | 278 } |
279 | 279 |
280 /* Unwind protection routine frees a dynarr opaqued into arg */ | 280 /* Unwind protection routine frees a dynarr opaqued into arg */ |
281 static Lisp_Object | 281 static Lisp_Object |
284 Dynarr_free (get_opaque_ptr (arg)); | 284 Dynarr_free (get_opaque_ptr (arg)); |
285 return arg; | 285 return arg; |
286 } | 286 } |
287 | 287 |
288 | 288 |
289 #define ALIGN_TEMPLATE \ | 289 #define ALIGN_TEMPLATE \ |
290 { \ | 290 { \ |
291 unsigned int slippage = Dynarr_length (template_) & 3; \ | 291 int slippage = Dynarr_length (template_) & 3; \ |
292 if (slippage) \ | 292 if (slippage) \ |
293 Dynarr_add_many (template_, &zeroes, slippage); \ | 293 Dynarr_add_many (template_, &zeroes, slippage); \ |
294 } | 294 } |
295 | 295 |
296 static struct | 296 static struct |
297 { | 297 { |
298 int errmess; | 298 DWORD errmess; |
299 char *errname; | 299 char *errname; |
300 } common_dialog_errors[] = | 300 } common_dialog_errors[] = |
301 { | 301 { |
302 { CDERR_DIALOGFAILURE, "CDERR_DIALOGFAILURE" }, | 302 { CDERR_DIALOGFAILURE, "CDERR_DIALOGFAILURE" }, |
303 { CDERR_FINDRESFAILURE, "CDERR_FINDRESFAILURE" }, | 303 { CDERR_FINDRESFAILURE, "CDERR_FINDRESFAILURE" }, |
412 static Lisp_Object | 412 static Lisp_Object |
413 handle_question_dialog_box (struct frame *f, Lisp_Object keys) | 413 handle_question_dialog_box (struct frame *f, Lisp_Object keys) |
414 { | 414 { |
415 Lisp_Object_dynarr *dialog_items = Dynarr_new (Lisp_Object); | 415 Lisp_Object_dynarr *dialog_items = Dynarr_new (Lisp_Object); |
416 unsigned_char_dynarr *template_ = Dynarr_new (unsigned_char); | 416 unsigned_char_dynarr *template_ = Dynarr_new (unsigned_char); |
417 unsigned int button_row_width = 0; | 417 int button_row_width = 0; |
418 unsigned int text_width, text_height; | 418 int text_width, text_height; |
419 Lisp_Object question = Qnil, title = Qnil; | 419 Lisp_Object question = Qnil, title = Qnil; |
420 | 420 |
421 int unbind_count = specpdl_depth (); | 421 int unbind_count = specpdl_depth (); |
422 record_unwind_protect (free_dynarr_opaque_ptr, | 422 record_unwind_protect (free_dynarr_opaque_ptr, |
423 make_opaque_ptr (dialog_items)); | 423 make_opaque_ptr (dialog_items)); |