current_column: Now returns EMACS_INT, fixing some iftc.
[bpt/emacs.git] / src / cmds.c
index 7e0eec9..5e6884c 100644 (file)
@@ -381,19 +381,22 @@ internal_self_insert (int c, EMACS_INT n)
        {
          EMACS_INT pos = PT;
          EMACS_INT pos_byte = PT_BYTE;
+
+         /* FIXME: Check for integer overflow when calculating
+            target_clm and actual_clm.  */
+
          /* Column the cursor should be placed at after this insertion.
             The correct value should be calculated only when necessary.  */
-         int target_clm = ((int) current_column () /* iftc */
-                           + n * (int) XINT (Fchar_width (make_number (c))));
+         EMACS_INT target_clm = (current_column ()
+                                 + n * XINT (Fchar_width (make_number (c))));
 
          /* The actual cursor position after the trial of moving
             to column TARGET_CLM.  It is greater than TARGET_CLM
             if the TARGET_CLM is middle of multi-column
             character.  In that case, the new point is set after
             that character.  */
-         int actual_clm
-           = (int) XFASTINT (Fmove_to_column (make_number (target_clm),
-                                              Qnil));
+         EMACS_INT actual_clm
+           = XFASTINT (Fmove_to_column (make_number (target_clm), Qnil));
 
          chars_to_delete = PT - pos;