aboutsummaryrefslogtreecommitdiffstats
path: root/src/coding.c
diff options
context:
space:
mode:
authorKenichi Handa2004-12-27 05:51:40 +0000
committerKenichi Handa2004-12-27 05:51:40 +0000
commitb3ebb2d471ef474f0142637e5e5e4784247d51d7 (patch)
treee84909fa74c438386ed89c85ce447eb9238190d0 /src/coding.c
parent82141d51c9cf0b7b75cec74d81c641ee73150b1d (diff)
downloademacs-b3ebb2d471ef474f0142637e5e5e4784247d51d7.tar.gz
emacs-b3ebb2d471ef474f0142637e5e5e4784247d51d7.zip
(code_convert_region): Fix calculation of `ratio'.
Diffstat (limited to 'src/coding.c')
-rw-r--r--src/coding.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/coding.c b/src/coding.c
index 93a18d1cd9c..c10d4800cbf 100644
--- a/src/coding.c
+++ b/src/coding.c
@@ -5881,7 +5881,6 @@ code_convert_region (from, from_byte, to, to_byte, coding, encodep, replace)
5881 REQUIRE + LEN_BYTE = LEN_BYTE * (NEW / ORIG) 5881 REQUIRE + LEN_BYTE = LEN_BYTE * (NEW / ORIG)
5882 REQUIRE = LEN_BYTE * (NEW - ORIG) / ORIG 5882 REQUIRE = LEN_BYTE * (NEW - ORIG) / ORIG
5883 Here, we are sure that NEW >= ORIG. */ 5883 Here, we are sure that NEW >= ORIG. */
5884 float ratio;
5885 5884
5886 if (coding->produced <= coding->consumed) 5885 if (coding->produced <= coding->consumed)
5887 { 5886 {
@@ -5891,7 +5890,8 @@ code_convert_region (from, from_byte, to, to_byte, coding, encodep, replace)
5891 } 5890 }
5892 else 5891 else
5893 { 5892 {
5894 ratio = (coding->produced - coding->consumed) / coding->consumed; 5893 float ratio = coding->produced - coding->consumed;
5894 ratio /= coding->consumed;
5895 require = len_byte * ratio; 5895 require = len_byte * ratio;
5896 } 5896 }
5897 first = 0; 5897 first = 0;