summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMattias EngdegÄrd <mattiase@acm.org>2019-07-22 13:45:40 +0200
committerMattias EngdegÄrd <mattiase@acm.org>2019-07-22 19:26:21 +0200
commit7e294d55e1506443e711f44c85caf490ded80fe8 (patch)
tree11549eb71f39826c4d044a3d3505ceee56084a78
parent87ad8a11437752f3a5f7f1096328e3b9d11bba9f (diff)
downloademacs-7e294d55e1506443e711f44c85caf490ded80fe8.tar.gz
Remove some obsolete integer overflow handling
* lisp/subr.el (number-sequence): * lisp/org/org-gnus.el (org-gnus-follow-link): * lisp/ls-lisp.el (ls-lisp-insert-directory): Remove dead code guarding against integer overflow.
-rw-r--r--lisp/ls-lisp.el9
-rw-r--r--lisp/org/org-gnus.el4
-rw-r--r--lisp/subr.el6
3 files changed, 4 insertions, 15 deletions
diff --git a/lisp/ls-lisp.el b/lisp/ls-lisp.el
index 66c56f0fcee..e802c2408f7 100644
--- a/lisp/ls-lisp.el
+++ b/lisp/ls-lisp.el
@@ -420,14 +420,7 @@ not contain `d', so that a full listing is expected."
attr (cdr elt)
file-size (file-attribute-size attr))
(and attr
- (setq sum (+ file-size
- ;; Even if neither SUM nor file's size
- ;; overflow, their sum could.
- (if (or (< sum (- 134217727 file-size))
- (floatp sum)
- (floatp file-size))
- sum
- (float sum))))
+ (setq sum (+ file-size sum))
(insert (ls-lisp-format short attr file-size
switches time-index))))
;; Insert total size of all files:
diff --git a/lisp/org/org-gnus.el b/lisp/org/org-gnus.el
index 2cb2766ee19..15e95647a09 100644
--- a/lisp/org/org-gnus.el
+++ b/lisp/org/org-gnus.el
@@ -242,9 +242,7 @@ If `org-store-link' was called with a prefix arg the meaning of
(_
(let ((articles 1)
group-opened)
- (while (and (not group-opened)
- ;; Stop on integer overflows.
- (> articles 0))
+ (while (not group-opened)
(setq group-opened (gnus-group-read-group articles t group))
(setq articles (if (< articles 16)
(1+ articles)
diff --git a/lisp/subr.el b/lisp/subr.el
index 4a1649f6019..9fd3366f8a6 100644
--- a/lisp/subr.el
+++ b/lisp/subr.el
@@ -681,14 +681,12 @@ of course, also replace TO with a slightly larger value
(when (zerop inc) (error "The increment can not be zero"))
(let (seq (n 0) (next from) (last from))
(if (> inc 0)
- ;; The (>= next last) condition protects against integer
- ;; overflow in computing NEXT.
- (while (and (>= next last) (<= next to))
+ (while (<= next to)
(setq seq (cons next seq)
n (1+ n)
last next
next (+ from (* n inc))))
- (while (and (<= next last) (>= next to))
+ (while (>= next to)
(setq seq (cons next seq)
n (1+ n)
next (+ from (* n inc)))))