+2010-09-22 Eli Zaretskii <eliz@gnu.org>
+
+ * minibuf.c (Fminibuffer_contents)
+ (Fminibuffer_contents_no_properties)
+ (Fminibuffer_completion_contents): Use EMACS_INT for minibuffer
+ positions.
+
+ * keyboard.c (command_loop_1): Use EMACS_INT to compare point with
+ mark.
+
+ * alloc.c (make_uninit_string, make_uninit_multibyte_string)
+ (allocate_string_data): Accept EMACS_INT for string length.
+
+ * editfns.c (Ffield_string, Ffield_string_no_properties)
+ (make_buffer_string, make_buffer_string_both, Fbuffer_substring)
+ (Fbuffer_substring_no_properties, find_field, Fdelete_field)
+ (Ffield_string, Ffield_string_no_properties, Ffield_beginning)
+ (Ffield_end): Use EMACS_INT for buffer positions.
+
+ * insdel.c (prepare_to_modify_buffer): Use EMACS_INT to compare
+ point with mark.
+
+ * lisp.h (allocate_string_data, make_uninit_string)
+ (make_uninit_multibyte_string, make_buffer_string)
+ (make_buffer_string_both): Adjust prototypes.
+
2010-09-22 Chong Yidong <cyd@stupidchicken.com>
* xml.c: Switch to GNU indentation.
S->data if it was initially non-null. */
void
-allocate_string_data (struct Lisp_String *s, int nchars, int nbytes)
+allocate_string_data (struct Lisp_String *s,
+ EMACS_INT nchars, EMACS_INT nbytes)
{
struct sdata *data, *old_data;
struct sblock *b;
occupying LENGTH bytes. */
Lisp_Object
-make_uninit_string (int length)
+make_uninit_string (EMACS_INT length)
{
Lisp_Object val;
which occupy NBYTES bytes. */
Lisp_Object
-make_uninit_multibyte_string (int nchars, int nbytes)
+make_uninit_multibyte_string (EMACS_INT nchars, EMACS_INT nbytes)
{
Lisp_Object string;
struct Lisp_String *s;
#endif
static int tm_diff (struct tm *, struct tm *);
-static void find_field (Lisp_Object, Lisp_Object, Lisp_Object, int *, Lisp_Object, int *);
+static void find_field (Lisp_Object, Lisp_Object, Lisp_Object,
+ EMACS_INT *, Lisp_Object, EMACS_INT *);
static void update_buffer_properties (int, int);
static Lisp_Object region_limit (int);
static size_t emacs_memftimeu (char *, size_t, const char *,
is not stored. */
static void
-find_field (Lisp_Object pos, Lisp_Object merge_at_boundary, Lisp_Object beg_limit, int *beg, Lisp_Object end_limit, int *end)
+find_field (Lisp_Object pos, Lisp_Object merge_at_boundary,
+ Lisp_Object beg_limit,
+ EMACS_INT *beg, Lisp_Object end_limit, EMACS_INT *end)
{
/* Fields right before and after the point. */
Lisp_Object before_field, after_field;
If POS is nil, the value of point is used for POS. */)
(Lisp_Object pos)
{
- int beg, end;
+ EMACS_INT beg, end;
find_field (pos, Qnil, Qnil, &beg, Qnil, &end);
if (beg != end)
del_range (beg, end);
If POS is nil, the value of point is used for POS. */)
(Lisp_Object pos)
{
- int beg, end;
+ EMACS_INT beg, end;
find_field (pos, Qnil, Qnil, &beg, Qnil, &end);
return make_buffer_string (beg, end, 1);
}
If POS is nil, the value of point is used for POS. */)
(Lisp_Object pos)
{
- int beg, end;
+ EMACS_INT beg, end;
find_field (pos, Qnil, Qnil, &beg, Qnil, &end);
return make_buffer_string (beg, end, 0);
}
is before LIMIT, then LIMIT will be returned instead. */)
(Lisp_Object pos, Lisp_Object escape_from_edge, Lisp_Object limit)
{
- int beg;
+ EMACS_INT beg;
find_field (pos, escape_from_edge, limit, &beg, Qnil, 0);
return make_number (beg);
}
is after LIMIT, then LIMIT will be returned instead. */)
(Lisp_Object pos, Lisp_Object escape_from_edge, Lisp_Object limit)
{
- int end;
+ EMACS_INT end;
find_field (pos, escape_from_edge, Qnil, 0, limit, &end);
return make_number (end);
}
buffer substrings. */
Lisp_Object
-make_buffer_string (int start, int end, int props)
+make_buffer_string (EMACS_INT start, EMACS_INT end, int props)
{
- int start_byte = CHAR_TO_BYTE (start);
- int end_byte = CHAR_TO_BYTE (end);
+ EMACS_INT start_byte = CHAR_TO_BYTE (start);
+ EMACS_INT end_byte = CHAR_TO_BYTE (end);
return make_buffer_string_both (start, start_byte, end, end_byte, props);
}
buffer substrings. */
Lisp_Object
-make_buffer_string_both (int start, int start_byte, int end, int end_byte, int props)
+make_buffer_string_both (EMACS_INT start, EMACS_INT start_byte,
+ EMACS_INT end, EMACS_INT end_byte, int props)
{
Lisp_Object result, tem, tem1;
use `buffer-substring-no-properties' instead. */)
(Lisp_Object start, Lisp_Object end)
{
- register int b, e;
+ register EMACS_INT b, e;
validate_region (&start, &end);
b = XINT (start);
they can be in either order. */)
(Lisp_Object start, Lisp_Object end)
{
- register int b, e;
+ register EMACS_INT b, e;
validate_region (&start, &end);
b = XINT (start);
: (!NILP (Vselect_active_regions)
&& !NILP (Vtransient_mark_mode))))
{
- int b = XINT (Fmarker_position (current_buffer->mark));
- int e = XINT (make_number (PT));
+ EMACS_INT b = XINT (Fmarker_position (current_buffer->mark));
+ EMACS_INT e = PT;
if (b < e)
Vsaved_region_selection = make_buffer_string (b, e, 0);
else if (b > e)
&& !NILP (Vtransient_mark_mode)))
&& !EQ (Vthis_command, Qhandle_switch_frame))
{
- int beg = XINT (Fmarker_position (current_buffer->mark));
- int end = XINT (make_number (PT));
+ EMACS_INT beg =
+ XINT (Fmarker_position (current_buffer->mark));
+ EMACS_INT end = PT;
if (beg < end)
call2 (Qx_set_selection, QPRIMARY,
make_buffer_string (beg, end, 0));
/* Defined in alloc.c */
extern void check_pure_size (void);
-extern void allocate_string_data (struct Lisp_String *, int, int);
+extern void allocate_string_data (struct Lisp_String *, EMACS_INT, EMACS_INT);
extern void reset_malloc_hooks (void);
extern void uninterrupt_malloc (void);
extern void malloc_warning (const char *);
extern Lisp_Object make_unibyte_string (const char *, int);
extern Lisp_Object make_multibyte_string (const char *, int, int);
extern Lisp_Object make_event_array (int, Lisp_Object *);
-extern Lisp_Object make_uninit_string (int);
-extern Lisp_Object make_uninit_multibyte_string (int, int);
+extern Lisp_Object make_uninit_string (EMACS_INT);
+extern Lisp_Object make_uninit_multibyte_string (EMACS_INT, EMACS_INT);
extern Lisp_Object make_string_from_bytes (const char *, int, int);
extern Lisp_Object make_specified_string (const char *, int, int, int);
EXFUN (Fpurecopy, 1);
EXFUN (Fsystem_name, 0);
EXFUN (Fcurrent_time, 0);
extern int clip_to_bounds (int, int, int);
-extern Lisp_Object make_buffer_string (int, int, int);
-extern Lisp_Object make_buffer_string_both (int, int, int, int, int);
+extern Lisp_Object make_buffer_string (EMACS_INT, EMACS_INT, int);
+extern Lisp_Object make_buffer_string_both (EMACS_INT, EMACS_INT, EMACS_INT,
+ EMACS_INT, int);
extern void init_editfns (void);
extern void syms_of_editfns (void);
EXFUN (Fconstrain_to_field, 5);
If the current buffer is not a minibuffer, return its entire contents. */)
(void)
{
- int prompt_end = XINT (Fminibuffer_prompt_end ());
+ EMACS_INT prompt_end = XINT (Fminibuffer_prompt_end ());
return make_buffer_string (prompt_end, ZV, 1);
}
If the current buffer is not a minibuffer, return its entire contents. */)
(void)
{
- int prompt_end = XINT (Fminibuffer_prompt_end ());
+ EMACS_INT prompt_end = XINT (Fminibuffer_prompt_end ());
return make_buffer_string (prompt_end, ZV, 0);
}
If the current buffer is not a minibuffer, return its entire contents. */)
(void)
{
- int prompt_end = XINT (Fminibuffer_prompt_end ());
+ EMACS_INT prompt_end = XINT (Fminibuffer_prompt_end ());
if (PT < prompt_end)
error ("Cannot do completion in the prompt");
return make_buffer_string (prompt_end, PT, 1);