aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorLars Magne Ingebrigtsen2010-09-23 22:16:55 +0200
committerLars Magne Ingebrigtsen2010-09-23 22:16:55 +0200
commit4028306292f1808f11131a9c6b32394cdaed4a34 (patch)
treeff76a41cf33552de6aa54c138429ccc6240b70b5 /src
parent84c9ce0579c1f16670d15c486dc3ceeb3c103af1 (diff)
downloademacs-4028306292f1808f11131a9c6b32394cdaed4a34.tar.gz
emacs-4028306292f1808f11131a9c6b32394cdaed4a34.zip
Clean up EMACS_INT/int in cmds.c, as well as USE_SAFE_ALLOCA.
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog11
-rw-r--r--src/cmds.c29
-rw-r--r--src/lisp.h4
-rw-r--r--src/lread.c2
4 files changed, 29 insertions, 17 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index b50e07c7fe0..233a521f027 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,14 @@
12010-09-23 Lars Magne Ingebrigtsen <larsi@gnus.org>
2
3 * lisp.h: Have oblookup take EMACS_INT to allow interning big
4 string and avoid compiler warnings.
5 (USE_SAFE_ALLOCA): Cast to int to avoid compilation warnings in
6 all users.
7
8 * lread.c (oblookup): EMACS_INT/int cleanup.
9
10 * cmds.c (Fforward_line, Fdelete_char): EMACS_INT/int cleanup.
11
12010-09-23 Eli Zaretskii <eliz@gnu.org> 122010-09-23 Eli Zaretskii <eliz@gnu.org>
2 13
3 * editfns.c (clip_to_bounds): Return an EMACS_INT value. 14 * editfns.c (clip_to_bounds): Return an EMACS_INT value.
diff --git a/src/cmds.c b/src/cmds.c
index 0e305e1fce4..0647810a42c 100644
--- a/src/cmds.c
+++ b/src/cmds.c
@@ -68,7 +68,7 @@ right or to the left on the screen. This is in contrast with
68 hooks, etcetera), that's not a good approach. So we validate the 68 hooks, etcetera), that's not a good approach. So we validate the
69 proposed position, then set point. */ 69 proposed position, then set point. */
70 { 70 {
71 int new_point = PT + XINT (n); 71 EMACS_INT new_point = PT + XINT (n);
72 72
73 if (new_point < BEGV) 73 if (new_point < BEGV)
74 { 74 {
@@ -116,9 +116,9 @@ With positive N, a non-empty line at the end counts as one line
116successfully moved (for the return value). */) 116successfully moved (for the return value). */)
117 (Lisp_Object n) 117 (Lisp_Object n)
118{ 118{
119 int opoint = PT, opoint_byte = PT_BYTE; 119 EMACS_INT opoint = PT, opoint_byte = PT_BYTE;
120 int pos, pos_byte; 120 EMACS_INT pos, pos_byte;
121 int count, shortage; 121 EMACS_INT count, shortage;
122 122
123 if (NILP (n)) 123 if (NILP (n))
124 count = 1; 124 count = 1;
@@ -188,7 +188,7 @@ not move. To ignore field boundaries bind `inhibit-field-text-motion'
188to t. */) 188to t. */)
189 (Lisp_Object n) 189 (Lisp_Object n)
190{ 190{
191 int newpos; 191 EMACS_INT newpos;
192 192
193 if (NILP (n)) 193 if (NILP (n))
194 XSETFASTINT (n, 1); 194 XSETFASTINT (n, 1);
@@ -233,7 +233,7 @@ N was explicitly specified.
233The command `delete-forward' is preferable for interactive use. */) 233The command `delete-forward' is preferable for interactive use. */)
234 (Lisp_Object n, Lisp_Object killflag) 234 (Lisp_Object n, Lisp_Object killflag)
235{ 235{
236 int pos; 236 EMACS_INT pos;
237 237
238 CHECK_NUMBER (n); 238 CHECK_NUMBER (n);
239 239
@@ -303,8 +303,8 @@ After insertion, the value of `auto-fill-function' is called if the
303 bitch_at_user (); 303 bitch_at_user ();
304 { 304 {
305 int character = translate_char (Vtranslation_table_for_input, 305 int character = translate_char (Vtranslation_table_for_input,
306 XINT (last_command_event)); 306 (int) XINT (last_command_event));
307 int val = internal_self_insert (character, XFASTINT (n)); 307 int val = internal_self_insert (character, (int) XFASTINT (n));
308 if (val == 2) 308 if (val == 2)
309 nonundocount = 0; 309 nonundocount = 0;
310 frame_make_pointer_invisible (); 310 frame_make_pointer_invisible ();
@@ -333,8 +333,8 @@ internal_self_insert (int c, int n)
333 int len; 333 int len;
334 /* Working buffer and pointer for multi-byte form of C. */ 334 /* Working buffer and pointer for multi-byte form of C. */
335 unsigned char str[MAX_MULTIBYTE_LENGTH]; 335 unsigned char str[MAX_MULTIBYTE_LENGTH];
336 int chars_to_delete = 0; 336 EMACS_INT chars_to_delete = 0;
337 int spaces_to_insert = 0; 337 EMACS_INT spaces_to_insert = 0;
338 338
339 overwrite = current_buffer->overwrite_mode; 339 overwrite = current_buffer->overwrite_mode;
340 if (!NILP (Vbefore_change_functions) || !NILP (Vafter_change_functions)) 340 if (!NILP (Vbefore_change_functions) || !NILP (Vafter_change_functions))
@@ -380,12 +380,12 @@ internal_self_insert (int c, int n)
380 chars_to_delete = n; 380 chars_to_delete = n;
381 else if (c != '\n' && c2 != '\n') 381 else if (c != '\n' && c2 != '\n')
382 { 382 {
383 int pos = PT; 383 EMACS_INT pos = PT;
384 int pos_byte = PT_BYTE; 384 EMACS_INT pos_byte = PT_BYTE;
385 /* Column the cursor should be placed at after this insertion. 385 /* Column the cursor should be placed at after this insertion.
386 The correct value should be calculated only when necessary. */ 386 The correct value should be calculated only when necessary. */
387 int target_clm = ((int) current_column () /* iftc */ 387 int target_clm = ((int) current_column () /* iftc */
388 + n * XINT (Fchar_width (make_number (c)))); 388 + n * (int) XINT (Fchar_width (make_number (c))));
389 389
390 /* The actual cursor position after the trial of moving 390 /* The actual cursor position after the trial of moving
391 to column TARGET_CLM. It is greater than TARGET_CLM 391 to column TARGET_CLM. It is greater than TARGET_CLM
@@ -393,7 +393,8 @@ internal_self_insert (int c, int n)
393 character. In that case, the new point is set after 393 character. In that case, the new point is set after
394 that character. */ 394 that character. */
395 int actual_clm 395 int actual_clm
396 = XFASTINT (Fmove_to_column (make_number (target_clm), Qnil)); 396 = (int) XFASTINT (Fmove_to_column (make_number (target_clm),
397 Qnil));
397 398
398 chars_to_delete = PT - pos; 399 chars_to_delete = PT - pos;
399 400
diff --git a/src/lisp.h b/src/lisp.h
index 17dbfab748e..bbc97241ef1 100644
--- a/src/lisp.h
+++ b/src/lisp.h
@@ -2839,7 +2839,7 @@ extern Lisp_Object check_obarray (Lisp_Object);
2839extern Lisp_Object intern (const char *); 2839extern Lisp_Object intern (const char *);
2840extern Lisp_Object intern_c_string (const char *); 2840extern Lisp_Object intern_c_string (const char *);
2841extern Lisp_Object make_symbol (const char *); 2841extern Lisp_Object make_symbol (const char *);
2842extern Lisp_Object oblookup (Lisp_Object, const char *, int, int); 2842extern Lisp_Object oblookup (Lisp_Object, const char *, EMACS_INT, EMACS_INT);
2843#define LOADHIST_ATTACH(x) \ 2843#define LOADHIST_ATTACH(x) \
2844 do { \ 2844 do { \
2845 if (initialized) Vcurrent_load_list = Fcons (x, Vcurrent_load_list); \ 2845 if (initialized) Vcurrent_load_list = Fcons (x, Vcurrent_load_list); \
@@ -3726,7 +3726,7 @@ extern void init_system_name (void);
3726extern Lisp_Object safe_alloca_unwind (Lisp_Object); 3726extern Lisp_Object safe_alloca_unwind (Lisp_Object);
3727 3727
3728#define USE_SAFE_ALLOCA \ 3728#define USE_SAFE_ALLOCA \
3729 int sa_count = SPECPDL_INDEX (), sa_must_free = 0 3729 int sa_count = (int) SPECPDL_INDEX (), sa_must_free = 0
3730 3730
3731/* SAFE_ALLOCA allocates a simple buffer. */ 3731/* SAFE_ALLOCA allocates a simple buffer. */
3732 3732
diff --git a/src/lread.c b/src/lread.c
index b616e30c3c6..a79ae180263 100644
--- a/src/lread.c
+++ b/src/lread.c
@@ -3739,7 +3739,7 @@ OBARRAY defaults to the value of the variable `obarray'. */)
3739 Also store the bucket number in oblookup_last_bucket_number. */ 3739 Also store the bucket number in oblookup_last_bucket_number. */
3740 3740
3741Lisp_Object 3741Lisp_Object
3742oblookup (Lisp_Object obarray, register const char *ptr, int size, int size_byte) 3742oblookup (Lisp_Object obarray, register const char *ptr, EMACS_INT size, EMACS_INT size_byte)
3743{ 3743{
3744 int hash; 3744 int hash;
3745 int obsize; 3745 int obsize;