changeset 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 43adca79c8fd
children 6248bcadfd21
files src/ChangeLog src/cmds.c src/lisp.h src/lread.c
diffstat 4 files changed, 29 insertions(+), 17 deletions(-) [+]
line wrap: on
line diff
--- a/src/ChangeLog	Thu Sep 23 21:53:46 2010 +0200
+++ b/src/ChangeLog	Thu Sep 23 22:16:55 2010 +0200
@@ -1,3 +1,14 @@
+2010-09-23  Lars Magne Ingebrigtsen  <larsi@gnus.org>
+
+	* lisp.h: Have oblookup take EMACS_INT to allow interning big
+	string and avoid compiler warnings.
+	(USE_SAFE_ALLOCA): Cast to int to avoid compilation warnings in
+	all users.
+
+	* lread.c (oblookup): EMACS_INT/int cleanup.
+
+	* cmds.c (Fforward_line, Fdelete_char): EMACS_INT/int cleanup.
+
 2010-09-23  Eli Zaretskii  <eliz@gnu.org>
 
 	* editfns.c (clip_to_bounds): Return an EMACS_INT value.
--- 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;
 
--- a/src/lisp.h	Thu Sep 23 21:53:46 2010 +0200
+++ b/src/lisp.h	Thu Sep 23 22:16:55 2010 +0200
@@ -2839,7 +2839,7 @@
 extern Lisp_Object intern (const char *);
 extern Lisp_Object intern_c_string (const char *);
 extern Lisp_Object make_symbol (const char *);
-extern Lisp_Object oblookup (Lisp_Object, const char *, int, int);
+extern Lisp_Object oblookup (Lisp_Object, const char *, EMACS_INT, EMACS_INT);
 #define LOADHIST_ATTACH(x) \
   do {									\
     if (initialized) Vcurrent_load_list = Fcons (x, Vcurrent_load_list); \
@@ -3726,7 +3726,7 @@
 extern Lisp_Object safe_alloca_unwind (Lisp_Object);
 
 #define USE_SAFE_ALLOCA			\
-  int sa_count = SPECPDL_INDEX (), sa_must_free = 0
+  int sa_count = (int) SPECPDL_INDEX (), sa_must_free = 0
 
 /* SAFE_ALLOCA allocates a simple buffer.  */
 
--- a/src/lread.c	Thu Sep 23 21:53:46 2010 +0200
+++ b/src/lread.c	Thu Sep 23 22:16:55 2010 +0200
@@ -3739,7 +3739,7 @@
    Also store the bucket number in oblookup_last_bucket_number.  */
 
 Lisp_Object
-oblookup (Lisp_Object obarray, register const char *ptr, int size, int size_byte)
+oblookup (Lisp_Object obarray, register const char *ptr, EMACS_INT size, EMACS_INT size_byte)
 {
   int hash;
   int obsize;