Mercurial > hg > xemacs-beta
comparison src/window.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 | 16ff693bd768 |
children | fdefd0186b75 |
comparison
equal
deleted
inserted
replaced
646:00c54252fe4f | 647:b39c14581166 |
---|---|
5081 Lisp_Object root_window; | 5081 Lisp_Object root_window; |
5082 int minibuf_height; /* 0 = no minibuffer, <0, size in lines, >0 in pixels */ | 5082 int minibuf_height; /* 0 = no minibuffer, <0, size in lines, >0 in pixels */ |
5083 /* Record the values of window-min-width and window-min-height | 5083 /* Record the values of window-min-width and window-min-height |
5084 so that window sizes remain consistent with them. */ | 5084 so that window sizes remain consistent with them. */ |
5085 int min_width, min_height; | 5085 int min_width, min_height; |
5086 unsigned int saved_windows_count; | 5086 int saved_windows_count; |
5087 /* Zero-sized arrays aren't ANSI C */ | 5087 /* Zero-sized arrays aren't ANSI C */ |
5088 struct saved_window saved_windows[1]; | 5088 struct saved_window saved_windows[1]; |
5089 }; | 5089 }; |
5090 | 5090 |
5091 #define SAVED_WINDOW_N(conf, n) (&((conf)->saved_windows[(n)])) | 5091 #define SAVED_WINDOW_N(conf, n) (&((conf)->saved_windows[(n)])) |
5097 | 5097 |
5098 static Lisp_Object | 5098 static Lisp_Object |
5099 mark_window_config (Lisp_Object obj) | 5099 mark_window_config (Lisp_Object obj) |
5100 { | 5100 { |
5101 struct window_config *config = XWINDOW_CONFIGURATION (obj); | 5101 struct window_config *config = XWINDOW_CONFIGURATION (obj); |
5102 unsigned int i; | 5102 int i; |
5103 mark_object (config->current_window); | 5103 mark_object (config->current_window); |
5104 mark_object (config->current_buffer); | 5104 mark_object (config->current_buffer); |
5105 mark_object (config->minibuffer_scroll_window); | 5105 mark_object (config->minibuffer_scroll_window); |
5106 mark_object (config->root_window); | 5106 mark_object (config->root_window); |
5107 | 5107 |
5127 #endif | 5127 #endif |
5128 } | 5128 } |
5129 return Qnil; | 5129 return Qnil; |
5130 } | 5130 } |
5131 | 5131 |
5132 inline static size_t | 5132 inline static Memory_Count |
5133 sizeof_window_config_for_n_windows (unsigned int n) | 5133 sizeof_window_config_for_n_windows (int n) |
5134 { | 5134 { |
5135 return FLEXIBLE_ARRAY_STRUCT_SIZEOF (struct window_config, | 5135 return FLEXIBLE_ARRAY_STRUCT_SIZEOF (struct window_config, |
5136 struct saved_window, saved_windows, n); | 5136 struct saved_window, saved_windows, n); |
5137 } | 5137 } |
5138 | 5138 |
5139 static size_t | 5139 static Memory_Count |
5140 sizeof_window_config (const void *h) | 5140 sizeof_window_config (const void *h) |
5141 { | 5141 { |
5142 const struct window_config *c = (const struct window_config *) h; | 5142 const struct window_config *c = (const struct window_config *) h; |
5143 return sizeof_window_config_for_n_windows (c->saved_windows_count); | 5143 return sizeof_window_config_for_n_windows (c->saved_windows_count); |
5144 } | 5144 } |
5197 are identical. */ | 5197 are identical. */ |
5198 static int | 5198 static int |
5199 window_config_equal (Lisp_Object conf1, Lisp_Object conf2) | 5199 window_config_equal (Lisp_Object conf1, Lisp_Object conf2) |
5200 { | 5200 { |
5201 struct window_config *fig1, *fig2; | 5201 struct window_config *fig1, *fig2; |
5202 unsigned int i; | 5202 int i; |
5203 | 5203 |
5204 /* First check if they are truly the same. */ | 5204 /* First check if they are truly the same. */ |
5205 if (EQ (conf1, conf2)) | 5205 if (EQ (conf1, conf2)) |
5206 return 1; | 5206 return 1; |
5207 | 5207 |
5252 | 5252 |
5253 /* Lisp_Object return value so it can be used in record_unwind_protect() */ | 5253 /* Lisp_Object return value so it can be used in record_unwind_protect() */ |
5254 static Lisp_Object | 5254 static Lisp_Object |
5255 free_window_configuration (Lisp_Object window_config) | 5255 free_window_configuration (Lisp_Object window_config) |
5256 { | 5256 { |
5257 unsigned int i; | 5257 int i; |
5258 struct window_config *config = XWINDOW_CONFIGURATION (window_config); | 5258 struct window_config *config = XWINDOW_CONFIGURATION (window_config); |
5259 | 5259 |
5260 /* Free all the markers. It's not completely necessary that | 5260 /* Free all the markers. It's not completely necessary that |
5261 we do this (window configs sitting in a free list aren't | 5261 we do this (window configs sitting in a free list aren't |
5262 marked normally so the markers wouldn't be marked anyway) | 5262 marked normally so the markers wouldn't be marked anyway) |
5304 { | 5304 { |
5305 struct window *w; | 5305 struct window *w; |
5306 struct window_config *config; | 5306 struct window_config *config; |
5307 struct saved_window *p; | 5307 struct saved_window *p; |
5308 Lisp_Object new_current_buffer; | 5308 Lisp_Object new_current_buffer; |
5309 unsigned int k; | 5309 int k; |
5310 Lisp_Object frame; | 5310 Lisp_Object frame; |
5311 struct frame *f; | 5311 struct frame *f; |
5312 struct gcpro gcpro1; | 5312 struct gcpro gcpro1; |
5313 Lisp_Object old_window_config; | 5313 Lisp_Object old_window_config; |
5314 /* int previous_frame_height; | 5314 /* int previous_frame_height; |
5803 | 5803 |
5804 mark_window_as_deleted (w); | 5804 mark_window_as_deleted (w); |
5805 } | 5805 } |
5806 | 5806 |
5807 | 5807 |
5808 static unsigned int | 5808 static int |
5809 count_windows (struct window *window) | 5809 count_windows (struct window *window) |
5810 { | 5810 { |
5811 return 1 + | 5811 return 1 + |
5812 (!NILP (window->next) ? count_windows (XWINDOW (window->next)) : 0) + | 5812 (!NILP (window->next) ? count_windows (XWINDOW (window->next)) : 0) + |
5813 (!NILP (window->vchild) ? count_windows (XWINDOW (window->vchild)) : 0) + | 5813 (!NILP (window->vchild) ? count_windows (XWINDOW (window->vchild)) : 0) + |
5919 (frame)) | 5919 (frame)) |
5920 { | 5920 { |
5921 Lisp_Object result; | 5921 Lisp_Object result; |
5922 struct frame *f = decode_frame (frame); | 5922 struct frame *f = decode_frame (frame); |
5923 struct window_config *config; | 5923 struct window_config *config; |
5924 unsigned int n_windows = count_windows (XWINDOW (FRAME_ROOT_WINDOW (f))); | 5924 int n_windows = count_windows (XWINDOW (FRAME_ROOT_WINDOW (f))); |
5925 int minibuf_height; | 5925 int minibuf_height; |
5926 int real_font_height; | 5926 int real_font_height; |
5927 | 5927 |
5928 if (n_windows <= countof (Vwindow_configuration_free_list)) | 5928 if (n_windows <= countof (Vwindow_configuration_free_list)) |
5929 config = XWINDOW_CONFIGURATION (allocate_managed_lcrecord | 5929 config = XWINDOW_CONFIGURATION (allocate_managed_lcrecord |
6232 } | 6232 } |
6233 | 6233 |
6234 void | 6234 void |
6235 reinit_vars_of_window (void) | 6235 reinit_vars_of_window (void) |
6236 { | 6236 { |
6237 unsigned int i; | 6237 int i; |
6238 /* Make sure all windows get marked */ | 6238 /* Make sure all windows get marked */ |
6239 minibuf_window = Qnil; | 6239 minibuf_window = Qnil; |
6240 staticpro_nodump (&minibuf_window); | 6240 staticpro_nodump (&minibuf_window); |
6241 | 6241 |
6242 for (i = 0; i < countof (Vwindow_configuration_free_list); i++) | 6242 for (i = 0; i < countof (Vwindow_configuration_free_list); i++) |