comparison src/version.c @ 18933:82c732e8d23d v8.2.0027

patch 8.2.0027: still some /* */ comments Commit: https://github.com/vim/vim/commit/aa2f0ee639d3b59e4402261ebee27bf545a62d8b Author: Bram Moolenaar <Bram@vim.org> Date: Sat Dec 21 18:47:26 2019 +0100 patch 8.2.0027: still some /* */ comments Problem: Still some /* */ comments. Solution: Convert to // comments.
author Bram Moolenaar <Bram@vim.org>
date Sat, 21 Dec 2019 19:00:03 +0100
parents 80b40bd5ec1a
children ed246d4c46ba
comparison
equal deleted inserted replaced
18932:ec2cc19cacf6 18933:82c732e8d23d
8 */ 8 */
9 9
10 #include "vim.h" 10 #include "vim.h"
11 11
12 #ifdef AMIGA 12 #ifdef AMIGA
13 # include <time.h> /* for time() */ 13 # include <time.h> // for time()
14 #endif 14 #endif
15 15
16 /* 16 /*
17 * Vim originated from Stevie version 3.6 (Fish disk 217) by GRWalter (Fred) 17 * Vim originated from Stevie version 3.6 (Fish disk 217) by GRWalter (Fred)
18 * It has been changed beyond recognition since then. 18 * It has been changed beyond recognition since then.
84 #ifdef HAVE_ACL 84 #ifdef HAVE_ACL
85 "+acl", 85 "+acl",
86 #else 86 #else
87 "-acl", 87 "-acl",
88 #endif 88 #endif
89 #ifdef AMIGA /* only for Amiga systems */ 89 #ifdef AMIGA // only for Amiga systems
90 # ifdef FEAT_ARP 90 # ifdef FEAT_ARP
91 "+ARP", 91 "+ARP",
92 # else 92 # else
93 "-ARP", 93 "-ARP",
94 # endif 94 # endif
267 #ifdef FEAT_FOOTER 267 #ifdef FEAT_FOOTER
268 "+footer", 268 "+footer",
269 #else 269 #else
270 "-footer", 270 "-footer",
271 #endif 271 #endif
272 /* only interesting on Unix systems */ 272 // only interesting on Unix systems
273 #if !defined(USE_SYSTEM) && defined(UNIX) 273 #if !defined(USE_SYSTEM) && defined(UNIX)
274 "+fork()", 274 "+fork()",
275 #endif 275 #endif
276 #ifdef FEAT_GETTEXT 276 #ifdef FEAT_GETTEXT
277 # ifdef DYNAMIC_GETTEXT 277 # ifdef DYNAMIC_GETTEXT
569 #ifdef FEAT_SYN_HL 569 #ifdef FEAT_SYN_HL
570 "+syntax", 570 "+syntax",
571 #else 571 #else
572 "-syntax", 572 "-syntax",
573 #endif 573 #endif
574 /* only interesting on Unix systems */ 574 // only interesting on Unix systems
575 #if defined(USE_SYSTEM) && defined(UNIX) 575 #if defined(USE_SYSTEM) && defined(UNIX)
576 "+system()", 576 "+system()",
577 #endif 577 #endif
578 #ifdef FEAT_TAG_BINS 578 #ifdef FEAT_TAG_BINS
579 "+tag_binary", 579 "+tag_binary",
600 "+terminal", 600 "+terminal",
601 #else 601 #else
602 "-terminal", 602 "-terminal",
603 #endif 603 #endif
604 #if defined(UNIX) 604 #if defined(UNIX)
605 /* only Unix can have terminfo instead of termcap */ 605 // only Unix can have terminfo instead of termcap
606 # ifdef TERMINFO 606 # ifdef TERMINFO
607 "+terminfo", 607 "+terminfo",
608 # else 608 # else
609 "-terminfo", 609 "-terminfo",
610 # endif 610 # endif
623 "+textprop", 623 "+textprop",
624 #else 624 #else
625 "-textprop", 625 "-textprop",
626 #endif 626 #endif
627 #if !defined(UNIX) 627 #if !defined(UNIX)
628 /* unix always includes termcap support */ 628 // unix always includes termcap support
629 # ifdef HAVE_TGETENT 629 # ifdef HAVE_TGETENT
630 "+tgetent", 630 "+tgetent",
631 # else 631 # else
632 "-tgetent", 632 "-tgetent",
633 # endif 633 # endif
740 NULL 740 NULL
741 }; 741 };
742 742
743 static int included_patches[] = 743 static int included_patches[] =
744 { /* Add new patch number below this line */ 744 { /* Add new patch number below this line */
745 /**/
746 27,
745 /**/ 747 /**/
746 26, 748 26,
747 /**/ 749 /**/
748 25, 750 25,
749 /**/ 751 /**/
901 int width = 0; 903 int width = 0;
902 #ifdef FEAT_SYN_HL 904 #ifdef FEAT_SYN_HL
903 int use_highlight = (items == (char_u **)features); 905 int use_highlight = (items == (char_u **)features);
904 #endif 906 #endif
905 907
906 /* Find the length of the longest item, use that + 1 as the column 908 // Find the length of the longest item, use that + 1 as the column
907 * width. */ 909 // width.
908 for (i = 0; size < 0 ? items[i] != NULL : i < size; ++i) 910 for (i = 0; size < 0 ? items[i] != NULL : i < size; ++i)
909 { 911 {
910 int l = (int)vim_strsize(items[i]) + (i == current ? 2 : 0); 912 int l = (int)vim_strsize(items[i]) + (i == current ? 2 : 0);
911 913
912 if (l > width) 914 if (l > width)
1033 } 1035 }
1034 # endif 1036 # endif
1035 1037
1036 #endif 1038 #endif
1037 1039
1038 /* Print the list of patch numbers if there is at least one. */ 1040 // Print the list of patch numbers if there is at least one.
1039 /* Print a range when patches are consecutive: "1-10, 12, 15-40, 42-45" */ 1041 // Print a range when patches are consecutive: "1-10, 12, 15-40, 42-45"
1040 if (included_patches[0] != 0) 1042 if (included_patches[0] != 0)
1041 { 1043 {
1042 msg_puts(_("\nIncluded patches: ")); 1044 msg_puts(_("\nIncluded patches: "));
1043 first = -1; 1045 first = -1;
1044 /* find last one */ 1046 // find last one
1045 for (i = 0; included_patches[i] != 0; ++i) 1047 for (i = 0; included_patches[i] != 0; ++i)
1046 ; 1048 ;
1047 while (--i >= 0) 1049 while (--i >= 0)
1048 { 1050 {
1049 if (first < 0) 1051 if (first < 0)
1061 first = -1; 1063 first = -1;
1062 } 1064 }
1063 } 1065 }
1064 } 1066 }
1065 1067
1066 /* Print the list of extra patch descriptions if there is at least one. */ 1068 // Print the list of extra patch descriptions if there is at least one.
1067 if (extra_patches[0] != NULL) 1069 if (extra_patches[0] != NULL)
1068 { 1070 {
1069 msg_puts(_("\nExtra patches: ")); 1071 msg_puts(_("\nExtra patches: "));
1070 s = ""; 1072 s = "";
1071 for (i = 0; extra_patches[i] != NULL; ++i) 1073 for (i = 0; extra_patches[i] != NULL; ++i)
1279 * Only used when starting Vim on an empty file, without a file name. 1281 * Only used when starting Vim on an empty file, without a file name.
1280 * Or with the ":intro" command (for Sven :-). 1282 * Or with the ":intro" command (for Sven :-).
1281 */ 1283 */
1282 void 1284 void
1283 intro_message( 1285 intro_message(
1284 int colon) /* TRUE for ":intro" */ 1286 int colon) // TRUE for ":intro"
1285 { 1287 {
1286 int i; 1288 int i;
1287 int row; 1289 int row;
1288 int blanklines; 1290 int blanklines;
1289 int sponsor; 1291 int sponsor;
1335 N_("menu Edit->Global Settings->Toggle Vi Compatible"), 1337 N_("menu Edit->Global Settings->Toggle Vi Compatible"),
1336 N_(" for Vim defaults "), 1338 N_(" for Vim defaults "),
1337 }; 1339 };
1338 #endif 1340 #endif
1339 1341
1340 /* blanklines = screen height - # message lines */ 1342 // blanklines = screen height - # message lines
1341 blanklines = (int)Rows - ((sizeof(lines) / sizeof(char *)) - 1); 1343 blanklines = (int)Rows - ((sizeof(lines) / sizeof(char *)) - 1);
1342 if (!p_cp) 1344 if (!p_cp)
1343 blanklines += 4; /* add 4 for not showing "Vi compatible" message */ 1345 blanklines += 4; // add 4 for not showing "Vi compatible" message
1344 1346
1345 /* Don't overwrite a statusline. Depends on 'cmdheight'. */ 1347 // Don't overwrite a statusline. Depends on 'cmdheight'.
1346 if (p_ls > 1) 1348 if (p_ls > 1)
1347 blanklines -= Rows - topframe->fr_height; 1349 blanklines -= Rows - topframe->fr_height;
1348 if (blanklines < 0) 1350 if (blanklines < 0)
1349 blanklines = 0; 1351 blanklines = 0;
1350 1352
1351 /* Show the sponsor and register message one out of four times, the Uganda 1353 // Show the sponsor and register message one out of four times, the Uganda
1352 * message two out of four times. */ 1354 // message two out of four times.
1353 sponsor = (int)time(NULL); 1355 sponsor = (int)time(NULL);
1354 sponsor = ((sponsor & 2) == 0) - ((sponsor & 4) == 0); 1356 sponsor = ((sponsor & 2) == 0) - ((sponsor & 4) == 0);
1355 1357
1356 /* start displaying the message lines after half of the blank lines */ 1358 // start displaying the message lines after half of the blank lines
1357 row = blanklines / 2; 1359 row = blanklines / 2;
1358 if ((row >= 2 && Columns >= 50) || colon) 1360 if ((row >= 2 && Columns >= 50) || colon)
1359 { 1361 {
1360 for (i = 0; i < (int)(sizeof(lines) / sizeof(char *)); ++i) 1362 for (i = 0; i < (int)(sizeof(lines) / sizeof(char *)); ++i)
1361 { 1363 {
1387 do_intro_line(row, (char_u *)_(p), i == 2, 0); 1389 do_intro_line(row, (char_u *)_(p), i == 2, 0);
1388 ++row; 1390 ++row;
1389 } 1391 }
1390 } 1392 }
1391 1393
1392 /* Make the wait-return message appear just below the text. */ 1394 // Make the wait-return message appear just below the text.
1393 if (colon) 1395 if (colon)
1394 msg_row = row; 1396 msg_row = row;
1395 } 1397 }
1396 1398
1397 static void 1399 static void
1417 vim_strncpy(modby + l, (char_u *)MODIFIED_BY, MODBY_LEN - l - 1); 1419 vim_strncpy(modby + l, (char_u *)MODIFIED_BY, MODBY_LEN - l - 1);
1418 mesg = modby; 1420 mesg = modby;
1419 } 1421 }
1420 #endif 1422 #endif
1421 1423
1422 /* Center the message horizontally. */ 1424 // Center the message horizontally.
1423 col = vim_strsize(mesg); 1425 col = vim_strsize(mesg);
1424 if (add_version) 1426 if (add_version)
1425 { 1427 {
1426 STRCPY(vers, mediumVersion); 1428 STRCPY(vers, mediumVersion);
1427 if (highest_patch()) 1429 if (highest_patch())
1428 { 1430 {
1429 /* Check for 9.9x or 9.9xx, alpha/beta version */ 1431 // Check for 9.9x or 9.9xx, alpha/beta version
1430 if (isalpha((int)vers[3])) 1432 if (isalpha((int)vers[3]))
1431 { 1433 {
1432 int len = (isalpha((int)vers[4])) ? 5 : 4; 1434 int len = (isalpha((int)vers[4])) ? 5 : 4;
1433 sprintf((char *)vers + len, ".%d%s", highest_patch(), 1435 sprintf((char *)vers + len, ".%d%s", highest_patch(),
1434 mediumVersion + len); 1436 mediumVersion + len);
1440 } 1442 }
1441 col = (Columns - col) / 2; 1443 col = (Columns - col) / 2;
1442 if (col < 0) 1444 if (col < 0)
1443 col = 0; 1445 col = 0;
1444 1446
1445 /* Split up in parts to highlight <> items differently. */ 1447 // Split up in parts to highlight <> items differently.
1446 for (p = mesg; *p != NUL; p += l) 1448 for (p = mesg; *p != NUL; p += l)
1447 { 1449 {
1448 clen = 0; 1450 clen = 0;
1449 for (l = 0; p[l] != NUL 1451 for (l = 0; p[l] != NUL
1450 && (l == 0 || (p[l] != '<' && p[l - 1] != '>')); ++l) 1452 && (l == 0 || (p[l] != '<' && p[l - 1] != '>')); ++l)
1459 } 1461 }
1460 screen_puts_len(p, l, row, col, *p == '<' ? HL_ATTR(HLF_8) : attr); 1462 screen_puts_len(p, l, row, col, *p == '<' ? HL_ATTR(HLF_8) : attr);
1461 col += clen; 1463 col += clen;
1462 } 1464 }
1463 1465
1464 /* Add the version number to the version line. */ 1466 // Add the version number to the version line.
1465 if (add_version) 1467 if (add_version)
1466 screen_puts(vers, row, col, 0); 1468 screen_puts(vers, row, col, 0);
1467 } 1469 }
1468 1470
1469 /* 1471 /*