patch 8.1.1885: comments in libvterm are inconsistent
Problem: Comments in libvterm are inconsistent.
Solution: Use // comments. Als update the table of combining characters.
diff --git a/src/libvterm/bin/unterm.c b/src/libvterm/bin/unterm.c
index 5c310d7..987ba69 100644
--- a/src/libvterm/bin/unterm.c
+++ b/src/libvterm/bin/unterm.c
@@ -208,14 +208,14 @@
}
static VTermScreenCallbacks cb_screen = {
- NULL, /* damage */
- NULL, /* moverect */
- NULL, /* movecursor */
- NULL, /* settermprop */
- NULL, /* bell */
- &screen_resize, /* resize */
- &screen_sb_pushline, /* sb_pushline */
- NULL, /* popline */
+ NULL, // damage
+ NULL, // moverect
+ NULL, // movecursor
+ NULL, // settermprop
+ NULL, // bell
+ &screen_resize, // resize
+ &screen_sb_pushline, // sb_pushline
+ NULL, // popline
};
int main(int argc, char *argv[])
diff --git a/src/libvterm/bin/vterm-ctrl.c b/src/libvterm/bin/vterm-ctrl.c
index 7c08fe1..9e06011 100644
--- a/src/libvterm/bin/vterm-ctrl.c
+++ b/src/libvterm/bin/vterm-ctrl.c
@@ -1,4 +1,4 @@
-#define _XOPEN_SOURCE 500 /* strdup */
+#define _XOPEN_SOURCE 500 // strdup
#include <stdio.h>
#include <stdlib.h>
@@ -86,7 +86,7 @@
{
unsigned char c;
- /* await CSI - 8bit or 2byte 7bit form */
+ // await CSI - 8bit or 2byte 7bit form
int in_esc = FALSE;
while((c = getchar())) {
if(c == c1)
@@ -107,8 +107,7 @@
await_c1(0x9B); // CSI
- /* TODO: This really should be a more robust CSI parser
- */
+ // TODO: This really should be a more robust CSI parser
for(; i < sizeof(csi)-1; i++) {
int c = csi[i] = getchar();
if(c >= 0x40 && c <= 0x7e)
@@ -175,12 +174,11 @@
free(s);
s = read_csi();
- /* expect "?" mode ";" value "$y" */
+ // expect "?" mode ";" value "$y"
- /* If the sscanf format string ends in a literal, we can't tell from
- * its return value if it matches. Hence we'll %c the cmd and check it
- * explicitly
- */
+ // If the sscanf format string ends in a literal, we can't tell from
+ // its return value if it matches. Hence we'll %c the cmd and check it
+ // explicitly
if(sscanf(s, "?%d;%d$%c", &reply_mode, &reply_value, &reply_cmd) < 3)
continue;
if(reply_cmd != 'y')
diff --git a/src/libvterm/bin/vterm-dump.c b/src/libvterm/bin/vterm-dump.c
index a299d9c..7d39165 100644
--- a/src/libvterm/bin/vterm-dump.c
+++ b/src/libvterm/bin/vterm-dump.c
@@ -21,7 +21,7 @@
unsigned char *b = (unsigned char *)bytes;
int i;
- for(i = 0; i < len; /* none */) {
+ for(i = 0; i < len; ) {
if(b[i] < 0x20) // C0
break;
else if(b[i] < 0x80) // ASCII
@@ -51,7 +51,7 @@
return i;
}
-/* 0 1 2 3 4 5 6 7 8 9 A B C D E F */
+// 0 1 2 3 4 5 6 7 8 9 A B C D E F
static const char *name_c0[] = {
"NUL", "SOH", "STX", "ETX", "EOT", "ENQ", "ACK", "BEL", "BS", "HT", "LF", "VT", "FF", "CR", "LS0", "LS1",
"DLE", "DC1", "DC2", "DC3", "DC4", "NAK", "SYN", "ETB", "CAN", "EM", "SUB", "ESC", "FS", "GS", "RS", "US",
@@ -91,14 +91,14 @@
return len;
}
-/* 0 1 2 3 4 5 6 7 8 9 A B C D E F */
+// 0 1 2 3 4 5 6 7 8 9 A B C D E F
static const char *name_csi_plain[] = {
"ICH", "CUU", "CUD", "CUF", "CUB", "CNL", "CPL", "CHA", "CUP", "CHT", "ED", "EL", "IL", "DL", "EF", "EA",
"DCH", "SSE", "CPR", "SU", "SD", "NP", "PP", "CTC", "ECH", "CVT", "CBT", "SRS", "PTX", "SDS", "SIMD",NULL,
"HPA", "HPR", "REP", "DA", "VPA", "VPR", "HVP", "TBC", "SM", "MC", "HPB", "VPB", "RM", "SGR", "DSR", "DAQ",
};
-/*0 4 8 B */
+//0 4 8 B
static const int newline_csi_plain[] = {
0, 1, 1, 0, 0, 1, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0,
@@ -111,7 +111,7 @@
if(!leader && !intermed && command < 0x70)
name = name_csi_plain[command - 0x40];
else if(leader && streq(leader, "?") && !intermed) {
- /* DEC */
+ // DEC
switch(command) {
case 'h': name = "DECSM"; break;
case 'l': name = "DECRM"; break;
@@ -172,13 +172,13 @@
}
static VTermParserCallbacks parser_cbs = {
- &parser_text, /* text */
- &parser_control, /* control */
- &parser_escape, /* escape */
- &parser_csi, /* csi */
- &parser_osc, /* osc */
- &parser_dcs, /* dcs */
- NULL /* resize */
+ &parser_text, // text
+ &parser_control, // control
+ &parser_escape, // escape
+ &parser_csi, // csi
+ &parser_osc, // osc
+ &parser_dcs, // dcs
+ NULL // resize
};
int main(int argc, char *argv[])
@@ -214,7 +214,7 @@
special_end = "}\x1b[m";
}
- /* Size matters not for the parser */
+ // Size matters not for the parser
vt = vterm_new(25, 80);
vterm_set_utf8(vt, 1);
vterm_parser_set_callbacks(vt, &parser_cbs, NULL);