To: vim_dev@googlegroups.com Subject: Patch 8.2.2521 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 8.2.2521 Problem: Some compilers can't handle pointer initialization. (John Marriott) Solution: Use a local struct and assign it afterwards. Files: src/screen.c *** ../vim-8.2.2520/src/screen.c 2021-02-15 20:37:58.457374538 +0100 --- src/screen.c 2021-02-16 22:21:05.351975055 +0100 *************** *** 4768,4787 **** {&fill_diff, "diff"}, {&fill_eob, "eob"}, }; struct charstab lcstab[] = { ! {&wp->w_lcs_chars.eol, "eol"}, ! {&wp->w_lcs_chars.ext, "extends"}, ! {&wp->w_lcs_chars.nbsp, "nbsp"}, ! {&wp->w_lcs_chars.prec, "precedes"}, ! {&wp->w_lcs_chars.space,"space"}, ! {&wp->w_lcs_chars.tab2, "tab"}, ! {&wp->w_lcs_chars.trail,"trail"}, ! {&wp->w_lcs_chars.lead, "lead"}, #ifdef FEAT_CONCEAL ! {&wp->w_lcs_chars.conceal, "conceal"}, #else ! {NULL, "conceal"}, #endif }; struct charstab *tab; --- 4768,4788 ---- {&fill_diff, "diff"}, {&fill_eob, "eob"}, }; + static lcs_chars_T lcs_chars; struct charstab lcstab[] = { ! {&lcs_chars.eol, "eol"}, ! {&lcs_chars.ext, "extends"}, ! {&lcs_chars.nbsp, "nbsp"}, ! {&lcs_chars.prec, "precedes"}, ! {&lcs_chars.space, "space"}, ! {&lcs_chars.tab2, "tab"}, ! {&lcs_chars.trail, "trail"}, ! {&lcs_chars.lead, "lead"}, #ifdef FEAT_CONCEAL ! {&lcs_chars.conceal, "conceal"}, #else ! {NULL, "conceal"}, #endif }; struct charstab *tab; *************** *** 4789,4794 **** --- 4790,4796 ---- if (varp == &p_lcs || varp == &wp->w_p_lcs) { tab = lcstab; + CLEAR_FIELD(lcs_chars); entries = sizeof(lcstab) / sizeof(struct charstab); if (varp == &wp->w_p_lcs && wp->w_p_lcs[0] == NUL) varp = &p_lcs; *************** *** 4813,4820 **** if (varp == &p_lcs || varp == &wp->w_p_lcs) { ! wp->w_lcs_chars.tab1 = NUL; ! wp->w_lcs_chars.tab3 = NUL; } else { --- 4815,4822 ---- if (varp == &p_lcs || varp == &wp->w_p_lcs) { ! lcs_chars.tab1 = NUL; ! lcs_chars.tab3 = NUL; } else { *************** *** 4837,4843 **** c1 = mb_ptr2char_adv(&s); if (mb_char2cells(c1) > 1) continue; ! if (tab[i].cp == &wp->w_lcs_chars.tab2) { if (*s == NUL) continue; --- 4839,4845 ---- c1 = mb_ptr2char_adv(&s); if (mb_char2cells(c1) > 1) continue; ! if (tab[i].cp == &lcs_chars.tab2) { if (*s == NUL) continue; *************** *** 4856,4866 **** { if (round) { ! if (tab[i].cp == &wp->w_lcs_chars.tab2) { ! wp->w_lcs_chars.tab1 = c1; ! wp->w_lcs_chars.tab2 = c2; ! wp->w_lcs_chars.tab3 = c3; } else if (tab[i].cp != NULL) *(tab[i].cp) = c1; --- 4858,4868 ---- { if (round) { ! if (tab[i].cp == &lcs_chars.tab2) { ! lcs_chars.tab1 = c1; ! lcs_chars.tab2 = c2; ! lcs_chars.tab3 = c3; } else if (tab[i].cp != NULL) *(tab[i].cp) = c1; *************** *** 4878,4883 **** --- 4880,4887 ---- ++p; } } + if (tab == lcstab) + wp->w_lcs_chars = lcs_chars; return NULL; // no error } *** ../vim-8.2.2520/src/version.c 2021-02-16 21:14:30.553742121 +0100 --- src/version.c 2021-02-16 22:14:35.541291031 +0100 *************** *** 752,753 **** --- 752,755 ---- { /* Add new patch number below this line */ + /**/ + 2521, /**/ -- CONCORDE: Quickly, sir, come this way! LAUNCELOT: No! It's not right for my idiom. I must escape more ... more ... CONCORDE: Dramatically, sir? LAUNCELOT: Dramatically. "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ \\\ an exciting new programming language -- http://www.Zimbu.org /// \\\ help me help AIDS victims -- http://ICCF-Holland.org ///