Patch 9.0.0776
Problem: MSVC can't have field name "small".
Solution: Rename small to smallfont.
Files: src/libvterm/include/vterm.h, src/libvterm/src/rect.h,
src/libvterm/src/vterm_internal.h, src/libvterm/src/pen.c,
src/libvterm/src/screen.c, src/libvterm/t/harness.c
*** ../vim-9.0.0775/src/libvterm/include/vterm.h 2022-10-16
19:26:31.676328577 +0100
--- src/libvterm/include/vterm.h 2022-10-16 20:17:42.344220076 +0100
***************
*** 528,534 ****
unsigned int font : 4; /* 0 to 9 */
unsigned int dwl : 1; /* On a DECDWL or DECDHL line */
unsigned int dhl : 2; /* On a DECDHL line (1=top 2=bottom) */
! unsigned int small : 1;
unsigned int baseline : 2;
} VTermScreenCellAttrs;
--- 528,534 ----
unsigned int font : 4; /* 0 to 9 */
unsigned int dwl : 1; /* On a DECDWL or DECDHL line */
unsigned int dhl : 2; /* On a DECDHL line (1=top 2=bottom) */
! unsigned int smallfont : 1;
unsigned int baseline : 2;
} VTermScreenCellAttrs;
*** ../vim-9.0.0775/src/libvterm/src/rect.h 2020-05-22 20:04:47.000000000
+0100
--- src/libvterm/src/rect.h 2022-10-16 20:18:52.996183574 +0100
***************
*** 35,47 ****
(a->end_col == b->end_col);
}
! /* True if small is contained entirely within big */
! static int rect_contains(VTermRect *big, VTermRect *small)
{
! if(small->start_row < big->start_row) return 0;
! if(small->start_col < big->start_col) return 0;
! if(small->end_row > big->end_row) return 0;
! if(small->end_col > big->end_col) return 0;
return 1;
}
--- 35,47 ----
(a->end_col == b->end_col);
}
! /* True if smallrect is contained entirely within big */
! static int rect_contains(VTermRect *big, VTermRect *smallrect)
{
! if(smallrect->start_row < big->start_row) return 0;
! if(smallrect->start_col < big->start_col) return 0;
! if(smallrect->end_row > big->end_row) return 0;
! if(smallrect->end_col > big->end_col) return 0;
return 1;
}
*** ../vim-9.0.0775/src/libvterm/src/vterm_internal.h 2022-10-16
19:26:31.680328579 +0100
--- src/libvterm/src/vterm_internal.h 2022-10-16 20:19:12.176172891 +0100
***************
*** 60,66 ****
unsigned int conceal:1;
unsigned int strike:1;
unsigned int font:4; /* To store 0-9 */
! unsigned int small:1;
unsigned int baseline:2;
};
--- 60,66 ----
unsigned int conceal:1;
unsigned int strike:1;
unsigned int font:4; /* To store 0-9 */
! unsigned int smallfont:1;
unsigned int baseline:2;
};
*** ../vim-9.0.0775/src/libvterm/src/pen.c 2022-10-16 19:26:31.676328577
+0100
--- src/libvterm/src/pen.c 2022-10-16 20:20:28.388127549 +0100
***************
*** 181,187 ****
state->pen.conceal = 0; setpenattr_bool(state, VTERM_ATTR_CONCEAL, 0);
state->pen.strike = 0; setpenattr_bool(state, VTERM_ATTR_STRIKE, 0);
state->pen.font = 0; setpenattr_int (state, VTERM_ATTR_FONT, 0);
! state->pen.small = 0; setpenattr_bool(state, VTERM_ATTR_SMALL, 0);
state->pen.baseline = 0; setpenattr_int (state, VTERM_ATTR_BASELINE, 0);
state->pen.fg = state->default_fg; setpenattr_col(state,
VTERM_ATTR_FOREGROUND, state->default_fg);
--- 181,187 ----
state->pen.conceal = 0; setpenattr_bool(state, VTERM_ATTR_CONCEAL, 0);
state->pen.strike = 0; setpenattr_bool(state, VTERM_ATTR_STRIKE, 0);
state->pen.font = 0; setpenattr_int (state, VTERM_ATTR_FONT, 0);
! state->pen.smallfont = 0; setpenattr_bool(state, VTERM_ATTR_SMALL, 0);
state->pen.baseline = 0; setpenattr_int (state, VTERM_ATTR_BASELINE, 0);
state->pen.fg = state->default_fg; setpenattr_col(state,
VTERM_ATTR_FOREGROUND, state->default_fg);
***************
*** 204,210 ****
setpenattr_bool(state, VTERM_ATTR_CONCEAL, state->pen.conceal);
setpenattr_bool(state, VTERM_ATTR_STRIKE, state->pen.strike);
setpenattr_int (state, VTERM_ATTR_FONT, state->pen.font);
! setpenattr_bool(state, VTERM_ATTR_SMALL, state->pen.small);
setpenattr_int (state, VTERM_ATTR_BASELINE, state->pen.baseline);
setpenattr_col( state, VTERM_ATTR_FOREGROUND, state->pen.fg);
--- 204,210 ----
setpenattr_bool(state, VTERM_ATTR_CONCEAL, state->pen.conceal);
setpenattr_bool(state, VTERM_ATTR_STRIKE, state->pen.strike);
setpenattr_int (state, VTERM_ATTR_FONT, state->pen.font);
! setpenattr_bool(state, VTERM_ATTR_SMALL, state->pen.smallfont);
setpenattr_int (state, VTERM_ATTR_BASELINE, state->pen.baseline);
setpenattr_col( state, VTERM_ATTR_FOREGROUND, state->pen.fg);
***************
*** 454,465 ****
case 73: // Superscript
case 74: // Subscript
case 75: // Superscript/subscript off
! state->pen.small = (arg != 75);
state->pen.baseline =
(arg == 73) ? VTERM_BASELINE_RAISE :
(arg == 74) ? VTERM_BASELINE_LOWER :
VTERM_BASELINE_NORMAL;
! setpenattr_bool(state, VTERM_ATTR_SMALL, state->pen.small);
setpenattr_int (state, VTERM_ATTR_BASELINE, state->pen.baseline);
break;
--- 454,465 ----
case 73: // Superscript
case 74: // Subscript
case 75: // Superscript/subscript off
! state->pen.smallfont = (arg != 75);
state->pen.baseline =
(arg == 73) ? VTERM_BASELINE_RAISE :
(arg == 74) ? VTERM_BASELINE_LOWER :
VTERM_BASELINE_NORMAL;
! setpenattr_bool(state, VTERM_ATTR_SMALL, state->pen.smallfont);
setpenattr_int (state, VTERM_ATTR_BASELINE, state->pen.baseline);
break;
***************
*** 560,566 ****
argi = vterm_state_getpen_color(&state->pen.bg, argi, args, FALSE);
! if(state->pen.small) {
if(state->pen.baseline == VTERM_BASELINE_RAISE)
args[argi++] = 73;
else if(state->pen.baseline == VTERM_BASELINE_LOWER)
--- 560,566 ----
argi = vterm_state_getpen_color(&state->pen.bg, argi, args, FALSE);
! if(state->pen.smallfont) {
if(state->pen.baseline == VTERM_BASELINE_RAISE)
args[argi++] = 73;
else if(state->pen.baseline == VTERM_BASELINE_LOWER)
***************
*** 614,620 ****
return 1;
case VTERM_ATTR_SMALL:
! val->boolean = state->pen.small;
return 1;
case VTERM_ATTR_BASELINE:
--- 614,620 ----
return 1;
case VTERM_ATTR_SMALL:
! val->boolean = state->pen.smallfont;
return 1;
case VTERM_ATTR_BASELINE:
*** ../vim-9.0.0775/src/libvterm/src/screen.c 2022-10-16 19:26:31.680328579
+0100
--- src/libvterm/src/screen.c 2022-10-16 20:21:16.484096796 +0100
***************
*** 26,32 ****
unsigned int conceal : 1;
unsigned int strike : 1;
unsigned int font : 4; /* 0 to 9 */
! unsigned int small : 1;
unsigned int baseline : 2;
/* Extra state storage that isn't strictly pen-related */
--- 26,32 ----
unsigned int conceal : 1;
unsigned int strike : 1;
unsigned int font : 4; /* 0 to 9 */
! unsigned int smallfont : 1;
unsigned int baseline : 2;
/* Extra state storage that isn't strictly pen-related */
***************
*** 446,452 ****
screen->pen.bg = val->color;
return 1;
case VTERM_ATTR_SMALL:
! screen->pen.small = val->boolean;
return 1;
case VTERM_ATTR_BASELINE:
screen->pen.baseline = val->number;
--- 446,452 ----
screen->pen.bg = val->color;
return 1;
case VTERM_ATTR_SMALL:
! screen->pen.smallfont = val->boolean;
return 1;
case VTERM_ATTR_BASELINE:
screen->pen.baseline = val->number;
***************
*** 700,706 ****
dst->pen.conceal = src->attrs.conceal;
dst->pen.strike = src->attrs.strike;
dst->pen.font = src->attrs.font;
! dst->pen.small = src->attrs.small;
dst->pen.baseline = src->attrs.baseline;
dst->pen.fg = src->fg;
--- 700,706 ----
dst->pen.conceal = src->attrs.conceal;
dst->pen.strike = src->attrs.strike;
dst->pen.font = src->attrs.font;
! dst->pen.smallfont = src->attrs.smallfont;
dst->pen.baseline = src->attrs.baseline;
dst->pen.fg = src->fg;
***************
*** 1014,1020 ****
cell->attrs.conceal = intcell->pen.conceal;
cell->attrs.strike = intcell->pen.strike;
cell->attrs.font = intcell->pen.font;
! cell->attrs.small = intcell->pen.small;
cell->attrs.baseline = intcell->pen.baseline;
cell->attrs.dwl = intcell->pen.dwl;
--- 1014,1020 ----
cell->attrs.conceal = intcell->pen.conceal;
cell->attrs.strike = intcell->pen.strike;
cell->attrs.font = intcell->pen.font;
! cell->attrs.smallfont = intcell->pen.smallfont;
cell->attrs.baseline = intcell->pen.baseline;
cell->attrs.dwl = intcell->pen.dwl;
***************
*** 1158,1164 ****
return 1;
if((attrs & VTERM_ATTR_BACKGROUND_MASK) &&
!vterm_color_is_equal(&a->pen.bg, &b->pen.bg))
return 1;
! if((attrs & VTERM_ATTR_SMALL_MASK) && (a->pen.small != b->pen.small))
return 1;
if((attrs & VTERM_ATTR_BASELINE_MASK) && (a->pen.baseline !=
b->pen.baseline))
return 1;
--- 1158,1164 ----
return 1;
if((attrs & VTERM_ATTR_BACKGROUND_MASK) &&
!vterm_color_is_equal(&a->pen.bg, &b->pen.bg))
return 1;
! if((attrs & VTERM_ATTR_SMALL_MASK) && (a->pen.smallfont !=
b->pen.smallfont))
return 1;
if((attrs & VTERM_ATTR_BASELINE_MASK) && (a->pen.baseline !=
b->pen.baseline))
return 1;
*** ../vim-9.0.0775/src/libvterm/t/harness.c 2022-10-16 19:26:31.680328579
+0100
--- src/libvterm/t/harness.c 2022-10-16 20:22:00.116067615 +0100
***************
*** 410,416 ****
int conceal;
int strike;
int font;
! int small;
int baseline;
VTermColor foreground;
VTermColor background;
--- 410,416 ----
int conceal;
int strike;
int font;
! int smallfont;
int baseline;
VTermColor foreground;
VTermColor background;
***************
*** 443,449 ****
state_pen.font = val->number;
break;
case VTERM_ATTR_SMALL:
! state_pen.small = val->boolean;
break;
case VTERM_ATTR_BASELINE:
state_pen.baseline = val->number;
--- 443,449 ----
state_pen.font = val->number;
break;
case VTERM_ATTR_SMALL:
! state_pen.smallfont = val->boolean;
break;
case VTERM_ATTR_BASELINE:
state_pen.baseline = val->number;
***************
*** 1015,1025 ****
}
else if(streq(linep, "small")) {
vterm_state_get_penattr(state, VTERM_ATTR_SMALL, &val);
! if(val.boolean != state_pen.small)
printf("! pen small mismatch; state=%s, event=%s\n",
! BOOLSTR(val.boolean), BOOLSTR(state_pen.small));
else
! printf("%s\n", BOOLSTR(state_pen.small));
}
else if(streq(linep, "baseline")) {
vterm_state_get_penattr(state, VTERM_ATTR_BASELINE, &val);
--- 1015,1025 ----
}
else if(streq(linep, "small")) {
vterm_state_get_penattr(state, VTERM_ATTR_SMALL, &val);
! if(val.boolean != state_pen.smallfont)
printf("! pen small mismatch; state=%s, event=%s\n",
! BOOLSTR(val.boolean), BOOLSTR(state_pen.smallfont));
else
! printf("%s\n", BOOLSTR(state_pen.smallfont));
}
else if(streq(linep, "baseline")) {
vterm_state_get_penattr(state, VTERM_ATTR_BASELINE, &val);
***************
*** 1160,1166 ****
if(cell.attrs.blink) printf("K");
if(cell.attrs.reverse) printf("R");
if(cell.attrs.font) printf("F%d", cell.attrs.font);
! if(cell.attrs.small) printf("S");
if(cell.attrs.baseline) printf(
cell.attrs.baseline == VTERM_BASELINE_RAISE ? "^" :
"_");
--- 1160,1166 ----
if(cell.attrs.blink) printf("K");
if(cell.attrs.reverse) printf("R");
if(cell.attrs.font) printf("F%d", cell.attrs.font);
! if(cell.attrs.smallfont) printf("S");
if(cell.attrs.baseline) printf(
cell.attrs.baseline == VTERM_BASELINE_RAISE ? "^" :
"_");
*** ../vim-9.0.0775/src/version.c 2022-10-16 19:45:24.562960629 +0100
--- src/version.c 2022-10-16 20:23:11.180017706 +0100
***************
*** 697,698 ****
--- 697,700 ----
{ /* Add new patch number below this line */
+ /**/
+ 776,
/**/
--
The Law, in its majestic equality, forbids the rich, as well as the
poor, to sleep under the bridges, to beg in the streets, and to steal
bread. -- Anatole France
/// 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/20221016192446.122EB1C05ED%40moolenaar.net.