Commit db063399 authored by Lars Magne Ingebrigtsen's avatar Lars Magne Ingebrigtsen
Browse files

Fix all EMACS_INT/int conversion errors in print.c (and related files).

parent 69481da7
2010-09-24 Lars Magne Ingebrigtsen <larsi@gnus.org>
* xdisp.c (message_dolog): Fix EMACS_INT/int conversion.
* eval.c (verror): Fix EMACS_INT/int conversion.
* print.c: (PRINTDECLARE, PRINTPREPARE, strout, print_string)
(print_preprocess, print_check_string_charset_prop)
(print_object): Fix EMACS_INT/int conversion.
* xdisp.c (message_dolog): Fix EMACS_INT/int conversion.
2010-09-24 Eli Zaretskii <eliz@gnu.org> 2010-09-24 Eli Zaretskii <eliz@gnu.org>
   
* callproc.c (Fcall_process): Use EMACS_INT for count of * callproc.c (Fcall_process): Use EMACS_INT for count of
...@@ -52,6 +64,8 @@ ...@@ -52,6 +64,8 @@
   
2010-09-23 Lars Magne Ingebrigtsen <larsi@gnus.org> 2010-09-23 Lars Magne Ingebrigtsen <larsi@gnus.org>
   
* eval.c (verror): EMACS_INT/int cleanup.
* lisp.h (SPECPDL_INDEX): Cast to int, since we're not going to * lisp.h (SPECPDL_INDEX): Cast to int, since we're not going to
unwind_protect more than 2GB worth of functions. unwind_protect more than 2GB worth of functions.
   
......
...@@ -2003,7 +2003,7 @@ verror (const char *m, va_list ap) ...@@ -2003,7 +2003,7 @@ verror (const char *m, va_list ap)
while (1) while (1)
{ {
int used; EMACS_INT used;
used = doprnt (buffer, size, m, m + mlen, ap); used = doprnt (buffer, size, m, m + mlen, ap);
if (used < size) if (used < size)
break; break;
......
...@@ -2667,7 +2667,7 @@ extern void message2 (const char *, int, int); ...@@ -2667,7 +2667,7 @@ extern void message2 (const char *, int, int);
extern void message2_nolog (const char *, int, int); extern void message2_nolog (const char *, int, int);
extern void message3 (Lisp_Object, int, int); extern void message3 (Lisp_Object, int, int);
extern void message3_nolog (Lisp_Object, int, int); extern void message3_nolog (Lisp_Object, int, int);
extern void message_dolog (const char *, int, int, int); extern void message_dolog (const char *, EMACS_INT, int, int);
extern void message_with_string (const char *, Lisp_Object, int); extern void message_with_string (const char *, Lisp_Object, int);
extern void message_log_maybe_newline (void); extern void message_log_maybe_newline (void);
extern void update_echo_area (void); extern void update_echo_area (void);
......
...@@ -96,11 +96,11 @@ Lisp_Object being_printed[PRINT_CIRCLE]; ...@@ -96,11 +96,11 @@ Lisp_Object being_printed[PRINT_CIRCLE];
char *print_buffer; char *print_buffer;
/* Size allocated in print_buffer. */ /* Size allocated in print_buffer. */
int print_buffer_size; EMACS_INT print_buffer_size;
/* Chars stored in print_buffer. */ /* Chars stored in print_buffer. */
int print_buffer_pos; EMACS_INT print_buffer_pos;
/* Bytes stored in print_buffer. */ /* Bytes stored in print_buffer. */
int print_buffer_pos_byte; EMACS_INT print_buffer_pos_byte;
/* Maximum length of list to print in full; noninteger means /* Maximum length of list to print in full; noninteger means
effectively infinity */ effectively infinity */
...@@ -177,8 +177,8 @@ int print_output_debug_flag = 1; ...@@ -177,8 +177,8 @@ int print_output_debug_flag = 1;
#define PRINTDECLARE \ #define PRINTDECLARE \
struct buffer *old = current_buffer; \ struct buffer *old = current_buffer; \
int old_point = -1, start_point = -1; \ EMACS_INT old_point = -1, start_point = -1; \
int old_point_byte = -1, start_point_byte = -1; \ EMACS_INT old_point_byte = -1, start_point_byte = -1; \
int specpdl_count = SPECPDL_INDEX (); \ int specpdl_count = SPECPDL_INDEX (); \
int free_print_buffer = 0; \ int free_print_buffer = 0; \
int multibyte = !NILP (current_buffer->enable_multibyte_characters); \ int multibyte = !NILP (current_buffer->enable_multibyte_characters); \
...@@ -342,8 +342,8 @@ printchar (unsigned int ch, Lisp_Object fun) ...@@ -342,8 +342,8 @@ printchar (unsigned int ch, Lisp_Object fun)
to data in a Lisp string. Otherwise that is not safe. */ to data in a Lisp string. Otherwise that is not safe. */
static void static void
strout (const char *ptr, int size, int size_byte, Lisp_Object printcharfun, strout (const char *ptr, EMACS_INT size, EMACS_INT size_byte,
int multibyte) Lisp_Object printcharfun, int multibyte)
{ {
if (size < 0) if (size < 0)
size_byte = size = strlen (ptr); size_byte = size = strlen (ptr);
...@@ -430,7 +430,7 @@ print_string (Lisp_Object string, Lisp_Object printcharfun) ...@@ -430,7 +430,7 @@ print_string (Lisp_Object string, Lisp_Object printcharfun)
{ {
if (EQ (printcharfun, Qt) || NILP (printcharfun)) if (EQ (printcharfun, Qt) || NILP (printcharfun))
{ {
int chars; EMACS_INT chars;
if (print_escape_nonascii) if (print_escape_nonascii)
string = string_escape_byte8 (string); string = string_escape_byte8 (string);
...@@ -446,7 +446,7 @@ print_string (Lisp_Object string, Lisp_Object printcharfun) ...@@ -446,7 +446,7 @@ print_string (Lisp_Object string, Lisp_Object printcharfun)
convert STRING to a multibyte string containing the same convert STRING to a multibyte string containing the same
character codes. */ character codes. */
Lisp_Object newstr; Lisp_Object newstr;
int bytes; EMACS_INT bytes;
chars = SBYTES (string); chars = SBYTES (string);
bytes = parse_str_to_multibyte (SDATA (string), chars); bytes = parse_str_to_multibyte (SDATA (string), chars);
...@@ -464,7 +464,7 @@ print_string (Lisp_Object string, Lisp_Object printcharfun) ...@@ -464,7 +464,7 @@ print_string (Lisp_Object string, Lisp_Object printcharfun)
if (EQ (printcharfun, Qt)) if (EQ (printcharfun, Qt))
{ {
/* Output to echo area. */ /* Output to echo area. */
int nbytes = SBYTES (string); EMACS_INT nbytes = SBYTES (string);
char *buffer; char *buffer;
/* Copy the string contents so that relocation of STRING by /* Copy the string contents so that relocation of STRING by
...@@ -490,8 +490,8 @@ print_string (Lisp_Object string, Lisp_Object printcharfun) ...@@ -490,8 +490,8 @@ print_string (Lisp_Object string, Lisp_Object printcharfun)
/* Otherwise, string may be relocated by printing one char. /* Otherwise, string may be relocated by printing one char.
So re-fetch the string address for each character. */ So re-fetch the string address for each character. */
int i; int i;
int size = SCHARS (string); EMACS_INT size = SCHARS (string);
int size_byte = SBYTES (string); EMACS_INT size_byte = SBYTES (string);
struct gcpro gcpro1; struct gcpro gcpro1;
GCPRO1 (string); GCPRO1 (string);
if (size == size_byte) if (size == size_byte)
...@@ -868,7 +868,7 @@ to make it write to the debugging output. */) ...@@ -868,7 +868,7 @@ to make it write to the debugging output. */)
(Lisp_Object character) (Lisp_Object character)
{ {
CHECK_NUMBER (character); CHECK_NUMBER (character);
putc (XINT (character), stderr); putc ((int) XINT (character), stderr);
#ifdef WINDOWSNT #ifdef WINDOWSNT
/* Send the output to a debugger (nothing happens if there isn't one). */ /* Send the output to a debugger (nothing happens if there isn't one). */
...@@ -1430,8 +1430,8 @@ print_check_string_charset_prop (INTERVAL interval, Lisp_Object string) ...@@ -1430,8 +1430,8 @@ print_check_string_charset_prop (INTERVAL interval, Lisp_Object string)
|| ! (print_check_string_result & PRINT_STRING_UNSAFE_CHARSET_FOUND)) || ! (print_check_string_result & PRINT_STRING_UNSAFE_CHARSET_FOUND))
{ {
int i, c; int i, c;
int charpos = interval->position; EMACS_INT charpos = interval->position;
int bytepos = string_char_to_byte (string, charpos); EMACS_INT bytepos = string_char_to_byte (string, charpos);
Lisp_Object charset; Lisp_Object charset;
charset = XCAR (XCDR (val)); charset = XCAR (XCDR (val));
...@@ -1566,7 +1566,7 @@ print_object (Lisp_Object obj, register Lisp_Object printcharfun, int escapeflag ...@@ -1566,7 +1566,7 @@ print_object (Lisp_Object obj, register Lisp_Object printcharfun, int escapeflag
register int i, i_byte; register int i, i_byte;
struct gcpro gcpro1; struct gcpro gcpro1;
unsigned char *str; unsigned char *str;
int size_byte; EMACS_INT size_byte;
/* 1 means we must ensure that the next character we output /* 1 means we must ensure that the next character we output
cannot be taken as part of a hex character escape. */ cannot be taken as part of a hex character escape. */
int need_nonhex = 0; int need_nonhex = 0;
...@@ -1684,7 +1684,8 @@ print_object (Lisp_Object obj, register Lisp_Object printcharfun, int escapeflag ...@@ -1684,7 +1684,8 @@ print_object (Lisp_Object obj, register Lisp_Object printcharfun, int escapeflag
register unsigned char *p = SDATA (SYMBOL_NAME (obj)); register unsigned char *p = SDATA (SYMBOL_NAME (obj));
register unsigned char *end = p + SBYTES (SYMBOL_NAME (obj)); register unsigned char *end = p + SBYTES (SYMBOL_NAME (obj));
register int c; register int c;
int i, i_byte, size_byte; int i, i_byte;
EMACS_INT size_byte;
Lisp_Object name; Lisp_Object name;
name = SYMBOL_NAME (obj); name = SYMBOL_NAME (obj);
...@@ -1803,7 +1804,8 @@ print_object (Lisp_Object obj, register Lisp_Object printcharfun, int escapeflag ...@@ -1803,7 +1804,8 @@ print_object (Lisp_Object obj, register Lisp_Object printcharfun, int escapeflag
} }
{ {
int print_length, i; EMACS_INT print_length;
int i;
Lisp_Object halftail = obj; Lisp_Object halftail = obj;
/* Negative values of print-length are invalid in CL. /* Negative values of print-length are invalid in CL.
...@@ -1898,7 +1900,7 @@ print_object (Lisp_Object obj, register Lisp_Object printcharfun, int escapeflag ...@@ -1898,7 +1900,7 @@ print_object (Lisp_Object obj, register Lisp_Object printcharfun, int escapeflag
register int i; register int i;
register unsigned char c; register unsigned char c;
struct gcpro gcpro1; struct gcpro gcpro1;
int size_in_chars EMACS_INT size_in_chars
= ((XBOOL_VECTOR (obj)->size + BOOL_VECTOR_BITS_PER_CHAR - 1) = ((XBOOL_VECTOR (obj)->size + BOOL_VECTOR_BITS_PER_CHAR - 1)
/ BOOL_VECTOR_BITS_PER_CHAR); / BOOL_VECTOR_BITS_PER_CHAR);
...@@ -1984,7 +1986,8 @@ print_object (Lisp_Object obj, register Lisp_Object printcharfun, int escapeflag ...@@ -1984,7 +1986,8 @@ print_object (Lisp_Object obj, register Lisp_Object printcharfun, int escapeflag
else if (HASH_TABLE_P (obj)) else if (HASH_TABLE_P (obj))
{ {
struct Lisp_Hash_Table *h = XHASH_TABLE (obj); struct Lisp_Hash_Table *h = XHASH_TABLE (obj);
int i, real_size, size; int i;
EMACS_INT real_size, size;
#if 0 #if 0
strout ("#<hash-table", -1, -1, printcharfun, 0); strout ("#<hash-table", -1, -1, printcharfun, 0);
if (SYMBOLP (h->test)) if (SYMBOLP (h->test))
...@@ -2150,7 +2153,7 @@ print_object (Lisp_Object obj, register Lisp_Object printcharfun, int escapeflag ...@@ -2150,7 +2153,7 @@ print_object (Lisp_Object obj, register Lisp_Object printcharfun, int escapeflag
{ {
register int i; register int i;
register Lisp_Object tem; register Lisp_Object tem;
int real_size = size; EMACS_INT real_size = size;
/* Don't print more elements than the specified maximum. */ /* Don't print more elements than the specified maximum. */
if (NATNUMP (Vprint_length) if (NATNUMP (Vprint_length)
......
...@@ -7990,7 +7990,7 @@ message_log_maybe_newline (void) ...@@ -7990,7 +7990,7 @@ message_log_maybe_newline (void)
so the buffer M must NOT point to a Lisp string. */ so the buffer M must NOT point to a Lisp string. */
   
void void
message_dolog (const char *m, int nbytes, int nlflag, int multibyte) message_dolog (const char *m, EMACS_INT nbytes, int nlflag, int multibyte)
{ {
if (!NILP (Vmemory_full)) if (!NILP (Vmemory_full))
return; return;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment