Patch 8.2.3641
Problem: Xxd code has duplicate expressions.
Solution: Refactor to avoid duplication. (closes #9185)
Files: src/xxd/xxd.c
*** ../vim-8.2.3640/src/xxd/xxd.c 2021-11-14 13:46:01.940689807 +0000
--- src/xxd/xxd.c 2021-11-22 11:54:38.436920019 +0000
***************
*** 811,834 ****
{
if (p == 0)
{
! if (decimal_offset)
! addrlen = sprintf(l, "%08ld:",
! ((unsigned long)(n + seekoff + displayoff)));
! else
! addrlen = sprintf(l, "%08lx:",
((unsigned long)(n + seekoff + displayoff)));
for (c = addrlen; c < LLEN; l[c++] = ' ');
}
! if (hextype == HEX_NORMAL)
! {
! l[c = (addrlen + 1 + (grplen * p) / octspergrp)] = hexx[(e >> 4) &
0xf];
! l[++c] = hexx[ e & 0xf];
! }
! else if (hextype == HEX_LITTLEENDIAN)
{
! int x = p ^ (octspergrp-1);
! l[c = (addrlen + 1 + (grplen * x) / octspergrp)] = hexx[(e >> 4) &
0xf];
! l[++c] = hexx[ e & 0xf];
}
else /* hextype == HEX_BITS */
{
--- 811,826 ----
{
if (p == 0)
{
! addrlen = sprintf(l, decimal_offset ? "%08ld:" : "%08lx:",
((unsigned long)(n + seekoff + displayoff)));
for (c = addrlen; c < LLEN; l[c++] = ' ');
}
! if (hextype == HEX_NORMAL || hextype == HEX_LITTLEENDIAN)
{
! int x = hextype == HEX_NORMAL ? p : p ^ (octspergrp-1);
! l[c = (addrlen + 1 + (grplen * x) / octspergrp)]
! = hexx[(e >> 4) & 0xf];
! l[++c] = hexx[e & 0xf];
}
else /* hextype == HEX_BITS */
{
*** ../vim-8.2.3640/src/version.c 2021-11-21 14:51:09.929191583 +0000
--- src/version.c 2021-11-22 11:57:21.692429796 +0000
***************
*** 759,760 ****
--- 759,762 ----
{ /* Add new patch number below this line */
+ /**/
+ 3641,
/**/
--
Veni, Vidi, VW -- I came, I saw, I drove around in a little car.
/// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net \\\
/// \\\
\\\ sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
--
--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
---
You received this message because you are subscribed to the Google Groups
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/vim_dev/20211122115836.4A08A1C3DEA%40moolenaar.net.