Commit c20db43f authored by Paul Eggert's avatar Paul Eggert

* intervals.h (struct interval): Use EMACS_INT for members

where EMACS_UINT might cause problems.  See
<http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html>.
(CHECK_TOTAL_LENGTH): Remove cast to EMACS_INT; no longer needed.
* intervals.c (interval_deletion_adjustment): Now returns EMACS_INT.
All uses changed.
parent 2538aa2f
2011-04-20 Paul Eggert <eggert@cs.ucla.edu>
* intervals.h (struct interval): Use EMACS_INT for members
where EMACS_UINT might cause problems. See
<http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html>.
(CHECK_TOTAL_LENGTH): Remove cast to EMACS_INT; no longer needed.
* intervals.c (interval_deletion_adjustment): Now returns EMACS_INT.
All uses changed.
* alloc.c (overrun_check_malloc, overrun_check_realloc): Now static.
(overrun_check_free): Likewise.
......
......@@ -1313,7 +1313,7 @@ delete_interval (register INTERVAL i)
Do this by recursing down TREE to the interval in question, and
deleting the appropriate amount of text. */
static EMACS_UINT
static EMACS_INT
interval_deletion_adjustment (register INTERVAL tree, register EMACS_INT from,
register EMACS_INT amount)
{
......@@ -1325,9 +1325,9 @@ interval_deletion_adjustment (register INTERVAL tree, register EMACS_INT from,
/* Left branch */
if (relative_position < LEFT_TOTAL_LENGTH (tree))
{
EMACS_UINT subtract = interval_deletion_adjustment (tree->left,
relative_position,
amount);
EMACS_INT subtract = interval_deletion_adjustment (tree->left,
relative_position,
amount);
tree->total_length -= subtract;
CHECK_TOTAL_LENGTH (tree);
return subtract;
......@@ -1336,7 +1336,7 @@ interval_deletion_adjustment (register INTERVAL tree, register EMACS_INT from,
else if (relative_position >= (TOTAL_LENGTH (tree)
- RIGHT_TOTAL_LENGTH (tree)))
{
EMACS_UINT subtract;
EMACS_INT subtract;
relative_position -= (tree->total_length
- RIGHT_TOTAL_LENGTH (tree));
......@@ -1378,7 +1378,7 @@ static void
adjust_intervals_for_deletion (struct buffer *buffer,
EMACS_INT start, EMACS_INT length)
{
register EMACS_UINT left_to_delete = length;
register EMACS_INT left_to_delete = length;
register INTERVAL tree = BUF_INTERVALS (buffer);
Lisp_Object parent;
EMACS_INT offset;
......
......@@ -27,8 +27,8 @@ struct interval
{
/* The first group of entries deal with the tree structure. */
EMACS_UINT total_length; /* Length of myself and both children. */
EMACS_UINT position; /* Cache of interval's character position. */
EMACS_INT total_length; /* Length of myself and both children. */
EMACS_INT position; /* Cache of interval's character position. */
/* This field is usually updated
simultaneously with an interval
traversal, there is no guarantee
......@@ -164,7 +164,7 @@ struct interval
#define CHECK_TOTAL_LENGTH(i) \
do \
{ \
if ((EMACS_INT) (i)->total_length < 0) \
if ((i)->total_length < 0) \
abort (); \
} \
while (0)
......
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