summaryrefslogtreecommitdiff
path: root/lisp/international/ja-dic-cnv.el
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2015-07-31 10:12:37 -0700
committerPaul Eggert <eggert@cs.ucla.edu>2015-07-31 10:13:38 -0700
commiteb0f65b4fbbea60100b53cb40a1d7138d47ad0d2 (patch)
treef2debb3a46b3e18217d8cd1736fc7d8add90e3bd /lisp/international/ja-dic-cnv.el
parent0f23e95b29a7a0a07bba0e9bc796cd7b7bc7232a (diff)
downloademacs-eb0f65b4fbbea60100b53cb40a1d7138d47ad0d2.tar.gz
Don't overflow if computing approximate percentage
* lisp/align.el (align-region): * lisp/cedet/semantic.el (semantic-repeat-parse-whole-stream): * lisp/cedet/semantic/wisent.el (wisent-parse-region): * lisp/cus-edit.el (custom-buffer-create-internal): * lisp/emacs-lisp/checkdoc.el (checkdoc-interactive-ispell-loop) (checkdoc-message-interactive-ispell-loop, checkdoc-next-error) (checkdoc-next-message-error): * lisp/emacs-lisp/eieio-opt.el (eieio-display-method-list): * lisp/epa.el (epa-progress-callback-function): * lisp/erc/erc-dcc.el (erc-dcc-do-LIST-command): * lisp/ffap.el (ffap-menu-rescan): * lisp/gnus/nnbabyl.el (nnbabyl-retrieve-headers): * lisp/gnus/nndiary.el (nndiary-retrieve-headers): * lisp/gnus/nneething.el (nneething-retrieve-headers): * lisp/gnus/nnmbox.el (nnmbox-retrieve-headers): * lisp/gnus/nnmh.el (nnmh-retrieve-headers): * lisp/gnus/nnml.el (nnml-retrieve-headers): * lisp/gnus/nnspool.el (nnspool-retrieve-headers): * lisp/gnus/nntp.el (nntp-retrieve-headers) (nntp-retrieve-articles): * lisp/imenu.el (imenu--relative-position): * lisp/international/ja-dic-cnv.el (skkdic-collect-okuri-nasi) (skkdic-convert-okuri-nasi): * lisp/net/ange-ftp.el (ange-ftp-process-handle-hash): * lisp/nxml/rng-valid.el (rng-compute-mode-line-string): * lisp/org/org-list.el (org-update-checkbox-count): * lisp/org/org.el (org-table-map-tables) (org-update-parent-todo-statistics): * lisp/play/decipher.el (decipher-insert-frequency-counts) (decipher-analyze-buffer): * lisp/profiler.el (profiler-format-percent): * lisp/progmodes/cc-cmds.el (c-progress-update): * lisp/progmodes/cpp.el (cpp-highlight-buffer): * lisp/progmodes/idlwave.el (idlwave-convert-xml-system-routine-info) (idlwave-list-load-path-shadows): * lisp/progmodes/opascal.el (opascal-step-progress): * lisp/progmodes/vhdl-mode.el (vhdl-update-progress-info) (vhdl-scan-directory-contents): * lisp/textmodes/bibtex.el (bibtex-progress-message): * lisp/textmodes/flyspell.el (flyspell-small-region) (flyspell-external-point-words): * lisp/textmodes/table.el (table-recognize): Prefer (floor (* 100.0 NUMERATOR) DENOMINATOR) when calculating progress-report percentages and the like. This avoids problems if (* 100 NUMERATOR) would overflow. * lisp/gnus/gnus-registry.el (gnus-registry-import-eld): * lisp/gnus/registry.el (registry-reindex): Use (* 100.0 ...) rather than (* 100 ...) to avoid int overflow issues. * lisp/descr-text.el (describe-char): * lisp/org/org-colview.el (org-nofm-to-completion): * lisp/ps-print.el (ps-plot): * lisp/simple.el (what-cursor-position): Prefer (round (* 100.0 NUMERATOR) DENOMINATOR) to a more-complicated and less-accurate approximation.
Diffstat (limited to 'lisp/international/ja-dic-cnv.el')
-rw-r--r--lisp/international/ja-dic-cnv.el4
1 files changed, 2 insertions, 2 deletions
diff --git a/lisp/international/ja-dic-cnv.el b/lisp/international/ja-dic-cnv.el
index edb6d8900e6..d9c77bf5652 100644
--- a/lisp/international/ja-dic-cnv.el
+++ b/lisp/international/ja-dic-cnv.el
@@ -280,7 +280,7 @@
(cons (cons kana candidates) skkdic-okuri-nasi-entries)
skkdic-okuri-nasi-entries-count
(1+ skkdic-okuri-nasi-entries-count))
- (setq ratio (floor (/ (* (point) 100.0) (point-max))))
+ (setq ratio (floor (* (point) 100.0) (point-max)))
(if (/= (/ prev-ratio 10) (/ ratio 10))
(progn
(message "collected %2d%% ..." ratio)
@@ -306,7 +306,7 @@
(while l
(let ((kana (car (car l)))
(candidates (cdr (car l))))
- (setq ratio (/ (* count 100) skkdic-okuri-nasi-entries-count)
+ (setq ratio (floor (* count 100.0) skkdic-okuri-nasi-entries-count)
count (1+ count))
(if (/= (/ prev-ratio 10) (/ ratio 10))
(progn