Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
emacs
emacs
Commits
1ea40aa2
Commit
1ea40aa2
authored
Oct 13, 2007
by
Eli Zaretskii
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Replace `abs' with `eabs'.
parent
555b10b0
Changes
14
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
70 additions
and
65 deletions
+70
-65
src/ChangeLog
src/ChangeLog
+4
-0
src/dispextern.h
src/dispextern.h
+2
-2
src/dispnew.c
src/dispnew.c
+1
-1
src/editfns.c
src/editfns.c
+1
-1
src/image.c
src/image.c
+3
-3
src/intervals.c
src/intervals.c
+2
-2
src/keyboard.c
src/keyboard.c
+4
-4
src/macterm.c
src/macterm.c
+7
-7
src/w32fns.c
src/w32fns.c
+3
-3
src/w32term.c
src/w32term.c
+8
-8
src/window.c
src/window.c
+4
-4
src/xdisp.c
src/xdisp.c
+5
-5
src/xfaces.c
src/xfaces.c
+13
-13
src/xterm.c
src/xterm.c
+13
-12
No files found.
src/ChangeLog
View file @
1ea40aa2
2007-10-13 Eli Zaretskii <eliz@gnu.org>
* lisp.h (eabs): Rename from `abs'. All callers changed.
2007-10-05 Dmitry Antipov <dmantipov@yandex.ru>
* buffer.c (add_overlay_mod_hooklist):
...
...
src/dispextern.h
View file @
1ea40aa2
...
...
@@ -680,9 +680,9 @@ struct glyph_row
short
used
[
LAST_AREA
];
/* Window-relative x and y-position of the top-left corner of this
row. If y < 0, this means that abs (y) pixels of the row are
row. If y < 0, this means that
e
abs (y) pixels of the row are
invisible because it is partially visible at the top of a window.
If x < 0, this means that abs (x) pixels of the first glyph of
If x < 0, this means that
e
abs (x) pixels of the first glyph of
the text area of the row are invisible because the glyph is
partially visible. */
int
x
,
y
;
...
...
src/dispnew.c
View file @
1ea40aa2
...
...
@@ -1993,7 +1993,7 @@ required_matrix_height (w)
if
(
FRAME_WINDOW_P
(
f
))
{
int
ch_height
=
FRAME_SMALLEST_FONT_HEIGHT
(
f
);
int window_pixel_height = window_box_height (w) + abs (w->vscroll);
int
window_pixel_height
=
window_box_height
(
w
)
+
e
abs
(
w
->
vscroll
);
return
(((
window_pixel_height
+
ch_height
-
1
)
/
ch_height
)
*
w
->
nrows_scale_factor
/* One partially visible line at the top and
...
...
src/editfns.c
View file @
1ea40aa2
...
...
@@ -1848,7 +1848,7 @@ usage: (encode-time SECOND MINUTE HOUR DAY MONTH YEAR &optional ZONE) */)
tzstring
=
(
char
*
)
SDATA
(
zone
);
else
if
(
INTEGERP
(
zone
))
{
int
abszone
=
abs
(
XINT
(
zone
));
int
abszone
=
e
abs
(
XINT
(
zone
));
sprintf
(
tzbuf
,
"XXX%s%d:%02d:%02d"
,
"-"
+
(
XINT
(
zone
)
<
0
),
abszone
/
(
60
*
60
),
(
abszone
/
60
)
%
60
,
abszone
%
60
);
tzstring
=
tzbuf
;
...
...
src/image.c
View file @
1ea40aa2
...
...
@@ -1984,8 +1984,8 @@ lookup_image (f, spec)
if (INTEGERP (relief))
{
img->relief = XINT (relief);
img->hmargin += abs (img->relief);
img->vmargin += abs (img->relief);
img->hmargin +=
e
abs (img->relief);
img->vmargin +=
e
abs (img->relief);
}
if (! img->background_valid)
...
...
@@ -5165,7 +5165,7 @@ x_detect_edges (f, img, matrix, color_adjust)
int x, y, i, sum;
for (i = sum = 0; i < 9; ++i)
sum += abs (matrix[i]);
sum +=
e
abs (matrix[i]);
#define COLOR(A, X, Y) ((A) + (Y) * img->width + (X))
...
...
src/intervals.c
View file @
1ea40aa2
...
...
@@ -427,7 +427,7 @@ balance_an_interval (i)
/* Since the left child is longer, there must be one. */
new_diff
=
i
->
total_length
-
i
->
left
->
total_length
+
RIGHT_TOTAL_LENGTH
(
i
->
left
)
-
LEFT_TOTAL_LENGTH
(
i
->
left
);
if
(
abs
(
new_diff
)
>=
old_diff
)
if
(
e
abs
(
new_diff
)
>=
old_diff
)
break
;
i
=
rotate_right
(
i
);
balance_an_interval
(
i
->
right
);
...
...
@@ -437,7 +437,7 @@ balance_an_interval (i)
/* Since the right child is longer, there must be one. */
new_diff
=
i
->
total_length
-
i
->
right
->
total_length
+
LEFT_TOTAL_LENGTH
(
i
->
right
)
-
RIGHT_TOTAL_LENGTH
(
i
->
right
);
if
(
abs
(
new_diff
)
>=
-
old_diff
)
if
(
e
abs
(
new_diff
)
>=
-
old_diff
)
break
;
i
=
rotate_left
(
i
);
balance_an_interval
(
i
->
left
);
...
...
src/keyboard.c
View file @
1ea40aa2
...
...
@@ -5707,8 +5707,8 @@ make_lispy_event (event)
fuzz = double_click_fuzz / 8;
is_double = (button == last_mouse_button
&& (abs (XINT (event->x) - last_mouse_x) <= fuzz)
&& (abs (XINT (event->y) - last_mouse_y) <= fuzz)
&& (
e
abs (XINT (event->x) - last_mouse_x) <= fuzz)
&& (
e
abs (XINT (event->y) - last_mouse_y) <= fuzz)
&& button_down_time != 0
&& (EQ (Vdouble_click_time, Qt)
|| (INTEGERP (Vdouble_click_time)
...
...
@@ -5876,8 +5876,8 @@ make_lispy_event (event)
fuzz = double_click_fuzz / 8;
is_double = (last_mouse_button < 0
&& (abs (XINT (event->x) - last_mouse_x) <= fuzz)
&& (abs (XINT (event->y) - last_mouse_y) <= fuzz)
&& (
e
abs (XINT (event->x) - last_mouse_x) <= fuzz)
&& (
e
abs (XINT (event->y) - last_mouse_y) <= fuzz)
&& button_down_time != 0
&& (EQ (Vdouble_click_time, Qt)
|| (INTEGERP (Vdouble_click_time)
...
...
src/macterm.c
View file @
1ea40aa2
...
...
@@ -2968,7 +2968,7 @@ x_draw_glyph_string_foreground (s)
of S to the right of that box line. */
if (s->face->box != FACE_NO_BOX
&& s->first_glyph->left_box_line_p)
x = s->x + abs (s->face->box_line_width);
x = s->x +
e
abs (s->face->box_line_width);
else
x = s->x;
...
...
@@ -3047,7 +3047,7 @@ x_draw_composite_glyph_string_foreground (s)
of S to the right of that box line. */
if (s->face->box != FACE_NO_BOX
&& s->first_glyph->left_box_line_p)
x = s->x + abs (s->face->box_line_width);
x = s->x +
e
abs (s->face->box_line_width);
else
x = s->x;
...
...
@@ -3542,7 +3542,7 @@ x_draw_glyph_string_box (s)
? s->first_glyph
: s->first_glyph + s->nchars - 1);
width = abs (s->face->box_line_width);
width =
e
abs (s->face->box_line_width);
raised_p = s->face->box == FACE_RAISED_BOX;
left_x = s->x;
right_x = (s->row->full_width_p && s->extends_to_end_of_line_p
...
...
@@ -3588,7 +3588,7 @@ x_draw_image_foreground (s)
if (s->face->box != FACE_NO_BOX
&& s->first_glyph->left_box_line_p
&& s->slice.x == 0)
x += abs (s->face->box_line_width);
x +=
e
abs (s->face->box_line_width);
/* If there is a margin around the image, adjust x- and y-position
by that margin. */
...
...
@@ -3661,7 +3661,7 @@ x_draw_image_relief (s)
if (s->face->box != FACE_NO_BOX
&& s->first_glyph->left_box_line_p
&& s->slice.x == 0)
x += abs (s->face->box_line_width);
x +=
e
abs (s->face->box_line_width);
/* If there is a margin around the image, adjust x- and y-position
by that margin. */
...
...
@@ -3678,7 +3678,7 @@ x_draw_image_relief (s)
}
else
{
thick = abs (s->img->relief);
thick =
e
abs (s->img->relief);
raised_p = s->img->relief > 0;
}
...
...
@@ -3739,7 +3739,7 @@ x_draw_image_glyph_string (s)
struct glyph_string *s;
{
int x, y;
int box_line_hwidth = abs (s->face->box_line_width);
int box_line_hwidth =
e
abs (s->face->box_line_width);
int box_line_vwidth = max (s->face->box_line_width, 0);
int height;
...
...
src/w32fns.c
View file @
1ea40aa2
...
...
@@ -5370,9 +5370,9 @@ w32_to_x_font (lplogfont, lpxstr, len, specific_charset)
if (lplogfont->lfHeight)
{
sprintf (height_pixels, "%u", abs (lplogfont->lfHeight));
sprintf (height_pixels, "%u",
e
abs (lplogfont->lfHeight));
sprintf (height_dpi, "%u",
abs (lplogfont->lfHeight) * 720 / display_resy);
e
abs (lplogfont->lfHeight) * 720 / display_resy);
}
else
{
...
...
@@ -5594,7 +5594,7 @@ x_to_w32_font (lpxstr, lplogfont)
}
/* This makes TrueType fonts work better. */
lplogfont->lfHeight = - abs (lplogfont->lfHeight);
lplogfont->lfHeight = -
e
abs (lplogfont->lfHeight);
return (TRUE);
}
...
...
src/w32term.c
View file @
1ea40aa2
...
...
@@ -1588,7 +1588,7 @@ x_draw_glyph_string_foreground (s)
of S to the right of that box line. */
if (s->face->box != FACE_NO_BOX
&& s->first_glyph->left_box_line_p)
x
=
s
->
x
+
abs
(
s
->
face
->
box_line_width
);
x = s->x +
e
abs (s->face->box_line_width);
else
x = s->x;
...
...
@@ -1660,7 +1660,7 @@ x_draw_composite_glyph_string_foreground (s)
of S to the right of that box line. */
if (s->face->box != FACE_NO_BOX
&& s->first_glyph->left_box_line_p)
x
=
s
->
x
+
abs
(
s
->
face
->
box_line_width
);
x = s->x +
e
abs (s->face->box_line_width);
else
x = s->x;
...
...
@@ -1990,7 +1990,7 @@ x_draw_glyph_string_box (s)
? s->first_glyph
: s->first_glyph + s->nchars - 1);
width
=
abs
(
s
->
face
->
box_line_width
);
width =
e
abs (s->face->box_line_width);
raised_p = s->face->box == FACE_RAISED_BOX;
left_x = s->x;
right_x = ((s->row->full_width_p && s->extends_to_end_of_line_p
...
...
@@ -2036,7 +2036,7 @@ x_draw_image_foreground (s)
if (s->face->box != FACE_NO_BOX
&& s->first_glyph->left_box_line_p
&& s->slice.x == 0)
x
+=
abs
(
s
->
face
->
box_line_width
);
x +=
e
abs (s->face->box_line_width);
/* If there is a margin around the image, adjust x- and y-position
by that margin. */
...
...
@@ -2129,7 +2129,7 @@ x_draw_image_relief (s)
if (s->face->box != FACE_NO_BOX
&& s->first_glyph->left_box_line_p
&& s->slice.x == 0)
x
+=
abs
(
s
->
face
->
box_line_width
);
x +=
e
abs (s->face->box_line_width);
/* If there is a margin around the image, adjust x- and y-position
by that margin. */
...
...
@@ -2146,7 +2146,7 @@ x_draw_image_relief (s)
}
else
{
thick
=
abs
(
s
->
img
->
relief
);
thick =
e
abs (s->img->relief);
raised_p = s->img->relief > 0;
}
...
...
@@ -2183,7 +2183,7 @@ w32_draw_image_foreground_1 (s, pixmap)
if (s->face->box != FACE_NO_BOX
&& s->first_glyph->left_box_line_p
&& s->slice.x == 0)
x
+=
abs
(
s
->
face
->
box_line_width
);
x +=
e
abs (s->face->box_line_width);
/* If there is a margin around the image, adjust x- and y-position
by that margin. */
...
...
@@ -2295,7 +2295,7 @@ x_draw_image_glyph_string (s)
struct glyph_string *s;
{
int x, y;
int
box_line_hwidth
=
abs
(
s
->
face
->
box_line_width
);
int box_line_hwidth =
e
abs (s->face->box_line_width);
int box_line_vwidth = max (s->face->box_line_width, 0);
int height;
HBITMAP pixmap = 0;
...
...
src/window.c
View file @
1ea40aa2
...
...
@@ -799,7 +799,7 @@ coordinates_in_window (w, x, y)
if (WINDOW_HAS_VERTICAL_SCROLL_BAR_ON_LEFT (w)
|| WINDOW_RIGHTMOST_P (w))
{
if (!WINDOW_LEFTMOST_P (w) && abs (*x - x0) < grabbable_width)
if (!WINDOW_LEFTMOST_P (w) &&
e
abs (*x - x0) < grabbable_width)
{
/* Convert X and Y to window relative coordinates.
Vertical border is at the left edge of window. */
...
...
@@ -810,7 +810,7 @@ coordinates_in_window (w, x, y)
}
else
{
if (abs (*x - x1) < grabbable_width)
if (
e
abs (*x - x1) < grabbable_width)
{
/* Convert X and Y to window relative coordinates.
Vertical border is at the right edge of window. */
...
...
@@ -858,7 +858,7 @@ coordinates_in_window (w, x, y)
if (!w->pseudo_window_p
&& !WINDOW_HAS_VERTICAL_SCROLL_BAR (w)
&& !WINDOW_RIGHTMOST_P (w)
&& (abs (*x - right_x) < grabbable_width))
&& (
e
abs (*x - right_x) < grabbable_width))
{
/* Convert X and Y to window relative coordinates.
Vertical border is at the right edge of window. */
...
...
@@ -5497,7 +5497,7 @@ scroll_command (n, direction)
{
int count = SPECPDL_INDEX ();
xassert (abs (direction) == 1);
xassert (
e
abs (direction) == 1);
/* If selected window's buffer isn't current, make it current for
the moment. But don't screw up if window_scroll gets an error. */
...
...
src/xdisp.c
View file @
1ea40aa2
...
...
@@ -12468,7 +12468,7 @@ compute_window_start_on_continuation_line (w)
minimum distance from the old window start. */
pos = it.current.pos;
min_distance = INFINITY;
while ((distance = abs (CHARPOS (start_pos) - IT_CHARPOS (it))),
while ((distance =
e
abs (CHARPOS (start_pos) - IT_CHARPOS (it))),
distance < min_distance)
{
min_distance = distance;
...
...
@@ -20029,9 +20029,9 @@ produce_image_glyph (it)
}
if (it->start_of_box_run_p && slice.x == 0)
it->pixel_width += abs (face->box_line_width);
it->pixel_width +=
e
abs (face->box_line_width);
if (it->end_of_box_run_p && slice.x + slice.width == img->width)
it->pixel_width += abs (face->box_line_width);
it->pixel_width +=
e
abs (face->box_line_width);
}
take_vertical_position_into_account (it);
...
...
@@ -22293,8 +22293,8 @@ fast_find_string_pos (w, pos, object, hpos, vpos, x, y, right_p)
goto found;
}
else if (best_glyph == NULL
|| ((abs (g->charpos - pos)
< abs (best_glyph->charpos - pos))
|| ((
e
abs (g->charpos - pos)
<
e
abs (best_glyph->charpos - pos))
&& (right_p
? g->charpos < pos
: g->charpos > pos)))
...
...
src/xfaces.c
View file @
1ea40aa2
...
...
@@ -1488,11 +1488,11 @@ face_color_gray_p (f, color_name)
gray_p = (/* Any color sufficiently close to black counts as grey. */
(color.red < 5000 && color.green < 5000 && color.blue < 5000)
||
((abs (color.red - color.green)
((
e
abs (color.red - color.green)
< max (color.red, color.green) / 20)
&& (abs (color.green - color.blue)
&& (
e
abs (color.green - color.blue)
< max (color.green, color.blue) / 20)
&& (abs (color.blue - color.red)
&& (
e
abs (color.blue - color.red)
< max (color.blue, color.red) / 20)));
else
gray_p = 0;
...
...
@@ -2714,7 +2714,7 @@ cmp_font_names (a, b)
int resy = FRAME_X_DISPLAY_INFO (font_frame)->resy;
int x_resy = x->numeric[XLFD_RESY];
int y_resy = y->numeric[XLFD_RESY];
cmp = abs (resy - x_resy) - abs (resy - y_resy);
cmp =
e
abs (resy - x_resy) -
e
abs (resy - y_resy);
}
}
...
...
@@ -5795,7 +5795,7 @@ smaller_face (f, face_id, steps)
/* Try in increments of 1/2 pt. */
delta = steps < 0 ? 5 : -5;
steps = abs (steps);
steps =
e
abs (steps);
face = FACE_FROM_ID (f, face_id);
bcopy (face->lface, attrs, sizeof attrs);
...
...
@@ -5806,7 +5806,7 @@ smaller_face (f, face_id, steps)
while (steps
&& pt + delta > 0
/* Give up if we cannot find a font within 10pt. */
&& abs (last_pt - pt) < 100)
&&
e
abs (last_pt - pt) < 100)
{
/* Look up a face for a slightly smaller/larger font. */
pt += delta;
...
...
@@ -6414,17 +6414,17 @@ better_font_p (values, font1, font2, compare_pt_p, avgwidth)
if (xlfd_idx == XLFD_POINT_SIZE)
{
delta1 = abs (values[i] - (font1->numeric[xlfd_idx]
delta1 =
e
abs (values[i] - (font1->numeric[xlfd_idx]
/ font1->rescale_ratio));
delta2 = abs (values[i] - (font2->numeric[xlfd_idx]
delta2 =
e
abs (values[i] - (font2->numeric[xlfd_idx]
/ font2->rescale_ratio));
if (abs (delta1 - delta2) < FONT_POINT_SIZE_QUANTUM)
if (
e
abs (delta1 - delta2) < FONT_POINT_SIZE_QUANTUM)
continue;
}
else
{
delta1 = abs (values[i] - font1->numeric[xlfd_idx]);
delta2 = abs (values[i] - font2->numeric[xlfd_idx]);
delta1 =
e
abs (values[i] - font1->numeric[xlfd_idx]);
delta2 =
e
abs (values[i] - font2->numeric[xlfd_idx]);
}
if (delta1 > delta2)
...
...
@@ -6446,8 +6446,8 @@ better_font_p (values, font1, font2, compare_pt_p, avgwidth)
if (avgwidth)
{
int delta1 = abs (avgwidth - font1->numeric[XLFD_AVGWIDTH]);
int delta2 = abs (avgwidth - font2->numeric[XLFD_AVGWIDTH]);
int delta1 =
e
abs (avgwidth - font1->numeric[XLFD_AVGWIDTH]);
int delta2 =
e
abs (avgwidth - font2->numeric[XLFD_AVGWIDTH]);
if (delta1 > delta2)
return 0;
else if (delta1 < delta2)
...
...
src/xterm.c
View file @
1ea40aa2
...
...
@@ -1322,7 +1322,7 @@ x_draw_glyph_string_foreground (s)
of S to the right of that box line. */
if (s->face->box != FACE_NO_BOX
&& s->first_glyph->left_box_line_p)
x = s->x + abs (s->face->box_line_width);
x = s->x +
e
abs (s->face->box_line_width);
else
x = s->x;
...
...
@@ -1404,7 +1404,7 @@ x_draw_composite_glyph_string_foreground (s)
of S to the right of that box line. */
if (s->face->box != FACE_NO_BOX
&& s->first_glyph->left_box_line_p)
x = s->x + abs (s->face->box_line_width);
x = s->x +
e
abs (s->face->box_line_width);
else
x = s->x;
...
...
@@ -2200,7 +2200,7 @@ x_draw_glyph_string_box (s)
? s->first_glyph
: s->first_glyph + s->nchars - 1);
width = abs (s->face->box_line_width);
width =
e
abs (s->face->box_line_width);
raised_p = s->face->box == FACE_RAISED_BOX;
left_x = s->x;
right_x = (s->row->full_width_p && s->extends_to_end_of_line_p
...
...
@@ -2246,7 +2246,7 @@ x_draw_image_foreground (s)
if (s->face->box != FACE_NO_BOX
&& s->first_glyph->left_box_line_p
&& s->slice.x == 0)
x += abs (s->face->box_line_width);
x +=
e
abs (s->face->box_line_width);
/* If there is a margin around the image, adjust x- and y-position
by that margin. */
...
...
@@ -2339,7 +2339,7 @@ x_draw_image_relief (s)
if (s->face->box != FACE_NO_BOX
&& s->first_glyph->left_box_line_p
&& s->slice.x == 0)
x += abs (s->face->box_line_width);
x +=
e
abs (s->face->box_line_width);
/* If there is a margin around the image, adjust x- and y-position
by that margin. */
...
...
@@ -2356,7 +2356,7 @@ x_draw_image_relief (s)
}
else
{
thick = abs (s->img->relief);
thick =
e
abs (s->img->relief);
raised_p = s->img->relief > 0;
}
...
...
@@ -2391,7 +2391,7 @@ x_draw_image_foreground_1 (s, pixmap)
if (s->face->box != FACE_NO_BOX
&& s->first_glyph->left_box_line_p
&& s->slice.x == 0)
x += abs (s->face->box_line_width);
x +=
e
abs (s->face->box_line_width);
/* If there is a margin around the image, adjust x- and y-position
by that margin. */
...
...
@@ -2491,7 +2491,7 @@ static void
x_draw_image_glyph_string (s)
struct glyph_string *s;
{
int box_line_hwidth = abs (s->face->box_line_width);
int box_line_hwidth =
e
abs (s->face->box_line_width);
int box_line_vwidth = max (s->face->box_line_width, 0);
int height;
Pixmap pixmap = None;
...
...
@@ -4385,7 +4385,7 @@ xaw_jump_callback (widget, client_data, call_data)
whole = 10000000;
portion = shown < 1 ? top * whole : 0;
if (shown < 1 && (abs (top + shown - 1) < 1.0/height))
if (shown < 1 && (
e
abs (top + shown - 1) < 1.0/height))
/* Some derivatives of Xaw refuse to shrink the thumb when you reach
the bottom, so we force the scrolling whenever we see that we're
too close to the bottom (in x_set_toolkit_scroll_bar_thumb
...
...
@@ -4426,12 +4426,12 @@ xaw_scroll_callback (widget, client_data, call_data)
XtVaGetValues (widget, XtNheight, &height, NULL);
UNBLOCK_INPUT;
if (abs (position) >= height)
if (
e
abs (position) >= height)
part = (position < 0) ? scroll_bar_above_handle : scroll_bar_below_handle;
/* If Xaw3d was compiled with ARROW_SCROLLBAR,
it maps line-movement to call_data = max(5, height/20). */
else if (xaw3d_arrow_scroll && abs (position) <= max (5, height / 20))
else if (xaw3d_arrow_scroll &&
e
abs (position) <= max (5, height / 20))
part = (position < 0) ? scroll_bar_up_arrow : scroll_bar_down_arrow;
else
part = scroll_bar_move_ratio;
...
...
@@ -8747,7 +8747,8 @@ x_sync_with_move (f, left, top, fuzzy)
/* The left fuzz-factor is 10 pixels. The top fuzz-factor is 40
pixels. */
if (abs (current_left - left) <= 10 && abs (current_top - top) <= 40)
if (eabs (current_left - left) <= 10
&& eabs (current_top - top) <= 40)
return;
}
else if (current_left == left && current_top == top)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment