XEmacs 21.2.43 "Terspichore".
[chise/xemacs-chise.git.1] / src / window.c
index 7790ce7..a3ad1b1 100644 (file)
@@ -5006,7 +5006,7 @@ struct window_config
   /* Record the values of window-min-width and window-min-height
      so that window sizes remain consistent with them.  */
   int min_width, min_height;
-  int saved_windows_count;
+  unsigned int saved_windows_count;
   /* Zero-sized arrays aren't ANSI C */
   struct saved_window saved_windows[1];
 };
@@ -5021,7 +5021,7 @@ static Lisp_Object
 mark_window_config (Lisp_Object obj)
 {
   struct window_config *config = XWINDOW_CONFIGURATION (obj);
-  int i;
+  unsigned int i;
   mark_object (config->current_window);
   mark_object (config->current_buffer);
   mark_object (config->minibuffer_scroll_window);
@@ -5050,12 +5050,11 @@ mark_window_config (Lisp_Object obj)
   return Qnil;
 }
 
-static size_t
-sizeof_window_config_for_n_windows (int n)
+inline static size_t
+sizeof_window_config_for_n_windows (unsigned int n)
 {
-  return (sizeof (struct window_config) +
-         /* n - 1 because zero-sized arrays aren't ANSI C */
-         (n - 1) *sizeof (struct saved_window));
+  return FLEXIBLE_ARRAY_STRUCT_SIZEOF (struct window_config,
+                                      struct saved_window, saved_windows, n);
 }
 
 static size_t
@@ -5120,7 +5119,7 @@ static int
 window_config_equal (Lisp_Object conf1, Lisp_Object conf2)
 {
   struct window_config *fig1, *fig2;
-  int i;
+  unsigned int i;
 
   /* First check if they are truly the same. */
   if (EQ (conf1, conf2))
@@ -5175,7 +5174,7 @@ mark_windows_in_use (struct frame *f, int mark)
 static Lisp_Object
 free_window_configuration (Lisp_Object window_config)
 {
-  int i;
+  unsigned int i;
   struct window_config *config = XWINDOW_CONFIGURATION (window_config);
 
   /* Free all the markers.  It's not completely necessary that
@@ -5227,7 +5226,7 @@ by `current-window-configuration' (which see).
   struct window_config *config;
   struct saved_window *p;
   Lisp_Object new_current_buffer;
-  int k;
+  unsigned int k;
   Lisp_Object frame;
   struct frame *f;
   struct gcpro gcpro1;
@@ -5725,7 +5724,7 @@ delete_all_subwindows (struct window *w)
 }
 
 \f
-static int
+static unsigned int
 count_windows (struct window *window)
 {
   return 1 +
@@ -5840,7 +5839,7 @@ its value is -not- saved.
   Lisp_Object result;
   struct frame *f = decode_frame (frame);
   struct window_config *config;
-  int n_windows = count_windows (XWINDOW (FRAME_ROOT_WINDOW (f)));
+  unsigned int n_windows = count_windows (XWINDOW (FRAME_ROOT_WINDOW (f)));
   int minibuf_height;
   int real_font_height;
 
@@ -6152,7 +6151,7 @@ syms_of_window (void)
 void
 reinit_vars_of_window (void)
 {
-  int i;
+  unsigned int i;
   /* Make sure all windows get marked */
   minibuf_window = Qnil;
   staticpro_nodump (&minibuf_window);