changeset 58265:491080266027

Avoid side-effects inside XSETFASTINT's arguments.
author Stefan Monnier <monnier@iro.umontreal.ca>
date Tue, 16 Nov 2004 15:35:14 +0000
parents e8156cc4a58f
children 9b0de37deb53
files src/fns.c src/frame.c src/window.c
diffstat 3 files changed, 10 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/src/fns.c	Tue Nov 16 15:32:33 2004 +0000
+++ b/src/fns.c	Tue Nov 16 15:35:14 2004 +0000
@@ -741,7 +741,7 @@
 		  }
 		else
 		  {
-		    XSETFASTINT (elt, SREF (this, thisindex++));
+		    XSETFASTINT (elt, SREF (this, thisindex)); thisindex++;
 		    if (some_multibyte
 			&& (XINT (elt) >= 0240
 			    || (XINT (elt) >= 0200
--- a/src/frame.c	Tue Nov 16 15:32:33 2004 +0000
+++ b/src/frame.c	Tue Nov 16 15:35:14 2004 +0000
@@ -371,7 +371,8 @@
   f->selected_window = root_window;
   /* Make sure this window seems more recently used than
      a newly-created, never-selected window.  */
-  XSETFASTINT (XWINDOW (f->selected_window)->use_time, ++window_select_count);
+  ++window_select_count;
+  XSETFASTINT (XWINDOW (f->selected_window)->use_time, window_select_count);
 
   f->default_face_done_p = 0;
 
--- a/src/window.c	Tue Nov 16 15:32:33 2004 +0000
+++ b/src/window.c	Tue Nov 16 15:35:14 2004 +0000
@@ -241,7 +241,8 @@
   register struct window *p;
 
   p = allocate_window ();
-  XSETFASTINT (p->sequence_number, ++sequence_number);
+  ++sequence_number;
+  XSETFASTINT (p->sequence_number, sequence_number);
   XSETFASTINT (p->left_col, 0);
   XSETFASTINT (p->top_line, 0);
   XSETFASTINT (p->total_lines, 0);
@@ -3149,7 +3150,8 @@
   w = XWINDOW (window);
   w->frozen_window_start_p = 0;
 
-  XSETFASTINT (w->use_time, ++window_select_count);
+  ++window_select_count;
+  XSETFASTINT (w->use_time, window_select_count);
   if (EQ (window, selected_window))
     return window;
 
@@ -3640,7 +3642,8 @@
       = ((struct Lisp_Vector *)o)->contents[i];
   XSETWINDOW (new, p);
 
-  XSETFASTINT (p->sequence_number, ++sequence_number);
+  ++sequence_number;
+  XSETFASTINT (p->sequence_number, sequence_number);
 
   /* Put new into window structure in place of window */
   replace_window (window, new);
@@ -5882,7 +5885,7 @@
       p = SAVED_WINDOW_N (vector, i);
       w = XWINDOW (window);
 
-      XSETFASTINT (w->temslot, i++);
+      XSETFASTINT (w->temslot, i); i++;
       p->window = window;
       p->buffer = w->buffer;
       p->left_col = w->left_col;