diff src/cmds.c @ 110514:8e5fcc5dd96b

Clean up EMACS_INT/int in cmds.c, as well as USE_SAFE_ALLOCA.
author Lars Magne Ingebrigtsen <larsi@gnus.org>
date Thu, 23 Sep 2010 22:16:55 +0200
parents 01aabf6189ef
children 66f6be9b4d43
line wrap: on
line diff
--- a/src/cmds.c	Thu Sep 23 21:53:46 2010 +0200
+++ b/src/cmds.c	Thu Sep 23 22:16:55 2010 +0200
@@ -68,7 +68,7 @@
      hooks, etcetera), that's not a good approach.  So we validate the
      proposed position, then set point.  */
   {
-    int new_point = PT + XINT (n);
+    EMACS_INT new_point = PT + XINT (n);
 
     if (new_point < BEGV)
       {
@@ -116,9 +116,9 @@
 successfully moved (for the return value).  */)
   (Lisp_Object n)
 {
-  int opoint = PT, opoint_byte = PT_BYTE;
-  int pos, pos_byte;
-  int count, shortage;
+  EMACS_INT opoint = PT, opoint_byte = PT_BYTE;
+  EMACS_INT pos, pos_byte;
+  EMACS_INT count, shortage;
 
   if (NILP (n))
     count = 1;
@@ -188,7 +188,7 @@
 to t.  */)
   (Lisp_Object n)
 {
-  int newpos;
+  EMACS_INT newpos;
 
   if (NILP (n))
     XSETFASTINT (n, 1);
@@ -233,7 +233,7 @@
 The command `delete-forward' is preferable for interactive use.  */)
   (Lisp_Object n, Lisp_Object killflag)
 {
-  int pos;
+  EMACS_INT pos;
 
   CHECK_NUMBER (n);
 
@@ -303,8 +303,8 @@
     bitch_at_user ();
   {
     int character = translate_char (Vtranslation_table_for_input,
-				    XINT (last_command_event));
-    int val = internal_self_insert (character, XFASTINT (n));
+				    (int) XINT (last_command_event));
+    int val = internal_self_insert (character, (int) XFASTINT (n));
     if (val == 2)
       nonundocount = 0;
     frame_make_pointer_invisible ();
@@ -333,8 +333,8 @@
   int len;
   /* Working buffer and pointer for multi-byte form of C.  */
   unsigned char str[MAX_MULTIBYTE_LENGTH];
-  int chars_to_delete = 0;
-  int spaces_to_insert = 0;
+  EMACS_INT chars_to_delete = 0;
+  EMACS_INT spaces_to_insert = 0;
 
   overwrite = current_buffer->overwrite_mode;
   if (!NILP (Vbefore_change_functions) || !NILP (Vafter_change_functions))
@@ -380,12 +380,12 @@
 	chars_to_delete = n;
       else if (c != '\n' && c2 != '\n')
 	{
-	  int pos = PT;
-	  int pos_byte = PT_BYTE;
+	  EMACS_INT pos = PT;
+	  EMACS_INT pos_byte = PT_BYTE;
 	  /* Column the cursor should be placed at after this insertion.
 	     The correct value should be calculated only when necessary.  */
 	  int target_clm = ((int) current_column () /* iftc */
-			    + n * XINT (Fchar_width (make_number (c))));
+			    + n * (int) XINT (Fchar_width (make_number (c))));
 
 	      /* The actual cursor position after the trial of moving
 		 to column TARGET_CLM.  It is greater than TARGET_CLM
@@ -393,7 +393,8 @@
 		 character.  In that case, the new point is set after
 		 that character.  */
 	      int actual_clm
-		= XFASTINT (Fmove_to_column (make_number (target_clm), Qnil));
+		= (int) XFASTINT (Fmove_to_column (make_number (target_clm),
+						   Qnil));
 
 	      chars_to_delete = PT - pos;