diff options
| author | Paul Eggert | 2019-07-22 16:26:27 -0700 |
|---|---|---|
| committer | Paul Eggert | 2019-07-22 16:36:50 -0700 |
| commit | c63e7f1bf6151d4bb5fde01890c69cdd515e2df3 (patch) | |
| tree | db9958355d3b0a85c9a621ba4f0f07eca391dc2d /lisp/scroll-bar.el | |
| parent | b904a238a5ab759a4d0d8c9ee5c48199febd8f62 (diff) | |
| download | emacs-c63e7f1bf6151d4bb5fde01890c69cdd515e2df3.tar.gz emacs-c63e7f1bf6151d4bb5fde01890c69cdd515e2df3.zip | |
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 | |||
| 49 | \(buffer-size)) is the position in the current buffer corresponding to | 49 | \(buffer-size)) is the position in the current buffer corresponding to |
| 50 | that scroll bar position." | 50 | that scroll bar position." |
| 51 | ;; We multiply before we divide to maintain precision. | 51 | ;; We multiply before we divide to maintain precision. |
| 52 | ;; We use floating point because the product of a large buffer size | 52 | (truncate (* (car num-denom) whole) (cdr num-denom))) |
| 53 | ;; with a large scroll bar portion can easily overflow a lisp int. | ||
| 54 | (truncate (/ (* (float (car num-denom)) whole) (cdr num-denom)))) | ||
| 55 | 53 | ||
| 56 | (defun scroll-bar-columns (side) | 54 | (defun scroll-bar-columns (side) |
| 57 | "Return the width, measured in columns, of the vertical scrollbar on SIDE. | 55 | "Return the width, measured in columns, of the vertical scrollbar on SIDE. |