Pass FUNCTION two args: an interval, and ARG. */
void
-traverse_intervals (INTERVAL tree, EMACS_UINT position,
+traverse_intervals (INTERVAL tree, EMACS_INT position,
void (*function) (INTERVAL, Lisp_Object), Lisp_Object arg)
{
while (!NULL_INTERVAL_P (tree))
{
INTERVAL i;
INTERVAL B = interval->left;
- EMACS_UINT old_total = interval->total_length;
+ EMACS_INT old_total = interval->total_length;
/* Deal with any Parent of A; make it point to B. */
if (! ROOT_INTERVAL_P (interval))
{
INTERVAL i;
INTERVAL B = interval->right;
- EMACS_UINT old_total = interval->total_length;
+ EMACS_INT old_total = interval->total_length;
/* Deal with any parent of A; make it point to B. */
if (! ROOT_INTERVAL_P (interval))
split_interval_right (INTERVAL interval, EMACS_INT offset)
{
INTERVAL new = make_interval ();
- EMACS_UINT position = interval->position;
- EMACS_UINT new_length = LENGTH (interval) - offset;
+ EMACS_INT position = interval->position;
+ EMACS_INT new_length = LENGTH (interval) - offset;
new->position = position + offset;
SET_INTERVAL_PARENT (new, interval);
{
/* The distance from the left edge of the subtree at TREE
to POSITION. */
- register EMACS_UINT relative_position;
+ register EMACS_INT relative_position;
if (NULL_INTERVAL_P (tree))
return NULL_INTERVAL;
next_interval (register INTERVAL interval)
{
register INTERVAL i = interval;
- register EMACS_UINT next_position;
+ register EMACS_INT next_position;
if (NULL_INTERVAL_P (i))
return NULL_INTERVAL;
delete_node (register INTERVAL i)
{
register INTERVAL migrate, this;
- register EMACS_UINT migrate_amt;
+ register EMACS_INT migrate_amt;
if (NULL_INTERVAL_P (i->left))
return i->right;
delete_interval (register INTERVAL i)
{
register INTERVAL parent;
- EMACS_UINT amt = LENGTH (i);
+ EMACS_INT amt = LENGTH (i);
if (amt > 0) /* Only used on zero-length intervals now. */
abort ();
Do this by recursing down TREE to the interval in question, and
deleting the appropriate amount of text. */
-static EMACS_UINT
-interval_deletion_adjustment (register INTERVAL tree, register EMACS_UINT from,
- register EMACS_UINT amount)
+static EMACS_INT
+interval_deletion_adjustment (register INTERVAL tree, register EMACS_INT from,
+ register EMACS_INT amount)
{
- register EMACS_UINT relative_position = from;
+ register EMACS_INT relative_position = from;
if (NULL_INTERVAL_P (tree))
return 0;
/* 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;
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));
else
{
/* How much can we delete from this interval? */
- EMACS_UINT my_amount = ((tree->total_length
+ EMACS_INT my_amount = ((tree->total_length
- RIGHT_TOTAL_LENGTH (tree))
- relative_position);
register EMACS_INT left_to_delete = length;
register INTERVAL tree = BUF_INTERVALS (buffer);
Lisp_Object parent;
- EMACS_UINT offset;
+ EMACS_INT offset;
GET_INTERVAL_OBJECT (parent, tree);
offset = (BUFFERP (parent) ? BUF_BEG (XBUFFER (parent)) : 0);
INTERVAL
merge_interval_right (register INTERVAL i)
{
- register EMACS_UINT absorb = LENGTH (i);
+ register EMACS_INT absorb = LENGTH (i);
register INTERVAL successor;
/* Zero out this interval. */
INTERVAL
merge_interval_left (register INTERVAL i)
{
- register EMACS_UINT absorb = LENGTH (i);
+ register EMACS_INT absorb = LENGTH (i);
register INTERVAL predecessor;
/* Zero out this interval. */
{
register INTERVAL under, over, this, prev;
register INTERVAL tree;
- EMACS_UINT over_used;
+ EMACS_INT over_used;
tree = BUF_INTERVALS (buffer);
copy_intervals (INTERVAL tree, EMACS_INT start, EMACS_INT length)
{
register INTERVAL i, new, t;
- register EMACS_UINT got, prevlen;
+ register EMACS_INT got, prevlen;
if (NULL_INTERVAL_P (tree) || length <= 0)
return NULL_INTERVAL;