diff options
author | Paul Eggert <eggert@cs.ucla.edu> | 2019-07-22 16:26:27 -0700 |
---|---|---|
committer | Paul Eggert <eggert@cs.ucla.edu> | 2019-07-22 16:36:50 -0700 |
commit | c63e7f1bf6151d4bb5fde01890c69cdd515e2df3 (patch) | |
tree | db9958355d3b0a85c9a621ba4f0f07eca391dc2d /lisp/scroll-bar.el | |
parent | b904a238a5ab759a4d0d8c9ee5c48199febd8f62 (diff) | |
download | emacs-c63e7f1bf6151d4bb5fde01890c69cdd515e2df3.tar.gz |
Remove no-longer-needed integer overflow code
* lisp/calculator.el (calculator-number-to-string):
Use truncate, not calculator-truncate, since integer
overflow cannot occur here.
* lisp/calendar/cal-persia.el (calendar-persian-year-from-absolute):
* lisp/gnus/gnus-agent.el (gnus-agent-read-article-number):
* lisp/gnus/nnmaildir.el (nnmaildir--group-maxnum)
(nnmaildir--new-number):
* lisp/scroll-bar.el (scroll-bar-scale):
* lisp/simple.el (beginning-of-buffer, end-of-buffer):
Simplify, now that integer overflow cannot occur.
Diffstat (limited to 'lisp/scroll-bar.el')
-rw-r--r-- | lisp/scroll-bar.el | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/lisp/scroll-bar.el b/lisp/scroll-bar.el index dc0df7ab3fe..61fa754e390 100644 --- a/lisp/scroll-bar.el +++ b/lisp/scroll-bar.el @@ -49,9 +49,7 @@ from a scroll bar event, then (scroll-bar-scale SCROLL-BAR-POS \(buffer-size)) is the position in the current buffer corresponding to that scroll bar position." ;; We multiply before we divide to maintain precision. - ;; We use floating point because the product of a large buffer size - ;; with a large scroll bar portion can easily overflow a lisp int. - (truncate (/ (* (float (car num-denom)) whole) (cdr num-denom)))) + (truncate (* (car num-denom) whole) (cdr num-denom))) (defun scroll-bar-columns (side) "Return the width, measured in columns, of the vertical scrollbar on SIDE. |