Commit 23017390 authored by Kenichi Handa's avatar Kenichi Handa
Browse files

(Ftranspose_regions): Use BYTE_POS_ADDR to get an

address in buffer from byte-position.
parent dff1aa24
...@@ -2985,8 +2985,8 @@ Transposing beyond buffer boundaries is an error.") ...@@ -2985,8 +2985,8 @@ Transposing beyond buffer boundaries is an error.")
/* Don't precompute these addresses. We have to compute them /* Don't precompute these addresses. We have to compute them
at the last minute, because the relocating allocator might at the last minute, because the relocating allocator might
have moved the buffer around during the xmalloc. */ have moved the buffer around during the xmalloc. */
start1_addr = BUF_CHAR_ADDRESS (current_buffer, start1_byte); start1_addr = BYTE_POS_ADDR (start1_byte);
start2_addr = BUF_CHAR_ADDRESS (current_buffer, start2_byte); start2_addr = BYTE_POS_ADDR (start2_byte);
bcopy (start2_addr, temp, len2_byte); bcopy (start2_addr, temp, len2_byte);
bcopy (start1_addr, start1_addr + len2_byte, len1_byte); bcopy (start1_addr, start1_addr + len2_byte, len1_byte);
...@@ -3001,8 +3001,8 @@ Transposing beyond buffer boundaries is an error.") ...@@ -3001,8 +3001,8 @@ Transposing beyond buffer boundaries is an error.")
temp = (unsigned char *) xmalloc (len1_byte); temp = (unsigned char *) xmalloc (len1_byte);
else else
temp = (unsigned char *) alloca (len1_byte); temp = (unsigned char *) alloca (len1_byte);
start1_addr = BUF_CHAR_ADDRESS (current_buffer, start1_byte); start1_addr = BYTE_POS_ADDR (start1_byte);
start2_addr = BUF_CHAR_ADDRESS (current_buffer, start2_byte); start2_addr = BYTE_POS_ADDR (start2_byte);
bcopy (start1_addr, temp, len1_byte); bcopy (start1_addr, temp, len1_byte);
bcopy (start2_addr, start1_addr, len2_byte); bcopy (start2_addr, start1_addr, len2_byte);
bcopy (temp, start1_addr + len2_byte, len1_byte); bcopy (temp, start1_addr + len2_byte, len1_byte);
...@@ -3041,8 +3041,8 @@ Transposing beyond buffer boundaries is an error.") ...@@ -3041,8 +3041,8 @@ Transposing beyond buffer boundaries is an error.")
temp = (unsigned char *) xmalloc (len1_byte); temp = (unsigned char *) xmalloc (len1_byte);
else else
temp = (unsigned char *) alloca (len1_byte); temp = (unsigned char *) alloca (len1_byte);
start1_addr = BUF_CHAR_ADDRESS (current_buffer, start1_byte); start1_addr = BYTE_POS_ADDR (start1_byte);
start2_addr = BUF_CHAR_ADDRESS (current_buffer, start2_byte); start2_addr = BYTE_POS_ADDR (start2_byte);
bcopy (start1_addr, temp, len1_byte); bcopy (start1_addr, temp, len1_byte);
bcopy (start2_addr, start1_addr, len2_byte); bcopy (start2_addr, start1_addr, len2_byte);
bcopy (temp, start2_addr, len1_byte); bcopy (temp, start2_addr, len1_byte);
...@@ -3074,8 +3074,8 @@ Transposing beyond buffer boundaries is an error.") ...@@ -3074,8 +3074,8 @@ Transposing beyond buffer boundaries is an error.")
temp = (unsigned char *) xmalloc (len2_byte); temp = (unsigned char *) xmalloc (len2_byte);
else else
temp = (unsigned char *) alloca (len2_byte); temp = (unsigned char *) alloca (len2_byte);
start1_addr = BUF_CHAR_ADDRESS (current_buffer, start1_byte); start1_addr = BYTE_POS_ADDR (start1_byte);
start2_addr = BUF_CHAR_ADDRESS (current_buffer, start2_byte); start2_addr = BYTE_POS_ADDR (start2_byte);
bcopy (start2_addr, temp, len2_byte); bcopy (start2_addr, temp, len2_byte);
bcopy (start1_addr, start1_addr + len_mid + len2_byte, len1_byte); bcopy (start1_addr, start1_addr + len_mid + len2_byte, len1_byte);
safe_bcopy (start1_addr + len1_byte, start1_addr + len2_byte, len_mid); safe_bcopy (start1_addr + len1_byte, start1_addr + len2_byte, len_mid);
...@@ -3110,8 +3110,8 @@ Transposing beyond buffer boundaries is an error.") ...@@ -3110,8 +3110,8 @@ Transposing beyond buffer boundaries is an error.")
temp = (unsigned char *) xmalloc (len1_byte); temp = (unsigned char *) xmalloc (len1_byte);
else else
temp = (unsigned char *) alloca (len1_byte); temp = (unsigned char *) alloca (len1_byte);
start1_addr = BUF_CHAR_ADDRESS (current_buffer, start1_byte); start1_addr = BYTE_POS_ADDR (start1_byte);
start2_addr = BUF_CHAR_ADDRESS (current_buffer, start2_byte); start2_addr = BYTE_POS_ADDR (start2_byte);
bcopy (start1_addr, temp, len1_byte); bcopy (start1_addr, temp, len1_byte);
bcopy (start2_addr, start1_addr, len2_byte); bcopy (start2_addr, start1_addr, len2_byte);
bcopy (start1_addr + len1_byte, start1_addr + len2_byte, len_mid); bcopy (start1_addr + len1_byte, start1_addr + len2_byte, len_mid);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment