]> code.delx.au - gnu-emacs/blobdiff - lisp/progmodes/cc-cmds.el
Don't overflow if computing approximate percentage
[gnu-emacs] / lisp / progmodes / cc-cmds.el
index 68075f356ab8a6c17de8433c5254b21152362ecc..c9f59451b7efc68b3ef993b9b40ba42551befa99 100644 (file)
@@ -1317,6 +1317,9 @@ keyword on the line, the keyword is not inserted inside a literal, and
   (autoload 'c-subword-mode "cc-subword"
     "Mode enabling subword movement and editing keys." t)))
 
+(declare-function c-forward-subword "ext:cc-subword" (&optional arg))
+(declare-function c-backward-subword "ext:cc-subword" (&optional arg))
+
 ;; "nomenclature" functions + c-scope-operator.
 (defun c-forward-into-nomenclature (&optional arg)
   "Compatibility alias for `c-forward-subword'."
@@ -1806,7 +1809,7 @@ with a brace block."
   (c-save-buffer-state
       (beginning-of-defun-function end-of-defun-function
        where pos name-end case-fold-search)
+
     (save-restriction
       (widen)
       (save-excursion
@@ -3409,7 +3412,7 @@ Otherwise reindent just the current line."
       (if (< c-progress-interval (- now lastsecs))
          (progn
            (message "Indenting region... (%d%% complete)"
-                    (/ (* 100 (- (point) start)) (- end start)))
+                    (floor (* 100.0 (- (point) start)) (- end start)))
            (aset c-progress-info 2 now)))
       )))