patch 8.0.1757: unnecessary changes in libvterm
Problem: Unnecessary changes in libvterm.
Solution: Bring back // comments and trailing comma in enums.
diff --git a/src/libvterm/bin/unterm.c b/src/libvterm/bin/unterm.c
index 3af2ecf..5c310d7 100644
--- a/src/libvterm/bin/unterm.c
+++ b/src/libvterm/bin/unterm.c
@@ -9,7 +9,7 @@
#include "vterm.h"
#define DEFINE_INLINES
-#include "../src/utf8.h" /* fill_utf8 */
+#include "../src/utf8.h" // fill_utf8
#define streq(a,b) (!strcmp(a,b))
@@ -21,7 +21,7 @@
static enum {
FORMAT_PLAIN,
- FORMAT_SGR
+ FORMAT_SGR,
} format = FORMAT_PLAIN;
static int col2index(VTermColor target)
@@ -44,8 +44,8 @@
break;
case FORMAT_SGR:
{
- /* If all 7 attributes change, that means 7 SGRs max */
- /* Each colour could consume up to 3 */
+ // If all 7 attributes change, that means 7 SGRs max
+ // Each colour could consume up to 3
int sgr[7 + 2*3]; int sgri = 0;
if(!prevcell->attrs.bold && cell->attrs.bold)
diff --git a/src/libvterm/bin/vterm-ctrl.c b/src/libvterm/bin/vterm-ctrl.c
index e43297c..7c08fe1 100644
--- a/src/libvterm/bin/vterm-ctrl.c
+++ b/src/libvterm/bin/vterm-ctrl.c
@@ -35,7 +35,7 @@
typedef enum {
OFF,
ON,
- QUERY
+ QUERY,
} BoolQuery;
static BoolQuery getboolq(int *argip, int argc, char *argv[])
@@ -105,7 +105,7 @@
unsigned char csi[32];
int i = 0;
- await_c1(0x9B); /* CSI */
+ await_c1(0x9B); // CSI
/* TODO: This really should be a more robust CSI parser
*/
@@ -116,7 +116,7 @@
}
csi[++i] = 0;
- /* TODO: returns longer than 32? */
+ // TODO: returns longer than 32?
return strdup((char *)csi);
}
@@ -131,7 +131,7 @@
for(i = 0; i < sizeof(dcs)-1; ) {
char c = getchar();
- if(c == 0x9c) /* ST */
+ if(c == 0x9c) // ST
break;
if(in_esc && c == 0x5c)
break;
@@ -301,12 +301,12 @@
do_dec_mode(12, getboolq(&argi, argc, argv), "curblink");
}
else if(streq(arg, "curshape")) {
- /* TODO: This ought to query the current value of DECSCUSR because it */
- /* may need blinking on or off */
+ // TODO: This ought to query the current value of DECSCUSR because it
+ // may need blinking on or off
const char *choices[] = {"block", "under", "bar", "query", NULL};
int shape = getchoice(&argi, argc, argv, choices);
switch(shape) {
- case 3: /* query */
+ case 3: // query
shape = query_rqss_numeric(" q");
switch(shape) {
case 1: case 2:
diff --git a/src/libvterm/bin/vterm-dump.c b/src/libvterm/bin/vterm-dump.c
index 9d0edf4..a299d9c 100644
--- a/src/libvterm/bin/vterm-dump.c
+++ b/src/libvterm/bin/vterm-dump.c
@@ -1,4 +1,4 @@
-/* Require getopt(3) */
+// Require getopt(3)
#define _XOPEN_SOURCE
#include <stdio.h>
@@ -22,28 +22,28 @@
int i;
for(i = 0; i < len; /* none */) {
- if(b[i] < 0x20) /* C0 */
+ if(b[i] < 0x20) // C0
break;
- else if(b[i] < 0x80) /* ASCII */
+ else if(b[i] < 0x80) // ASCII
i++;
- else if(b[i] < 0xa0) /* C1 */
+ else if(b[i] < 0xa0) // C1
break;
- else if(b[i] < 0xc0) /* UTF-8 continuation */
+ else if(b[i] < 0xc0) // UTF-8 continuation
break;
- else if(b[i] < 0xe0) { /* UTF-8 2-byte */
- /* 2-byte UTF-8 */
+ else if(b[i] < 0xe0) { // UTF-8 2-byte
+ // 2-byte UTF-8
if(len < i+2) break;
i += 2;
}
- else if(b[i] < 0xf0) { /* UTF-8 3-byte */
+ else if(b[i] < 0xf0) { // UTF-8 3-byte
if(len < i+3) break;
i += 3;
}
- else if(b[i] < 0xf8) { /* UTF-8 4-byte */
+ else if(b[i] < 0xf8) { // UTF-8 4-byte
if(len < i+4) break;
i += 4;
}
- else /* otherwise invalid */
+ else // otherwise invalid
break;
}
@@ -200,7 +200,7 @@
file = argv[optind++];
if(!file || streq(file, "-"))
- fd = 0; /* stdin */
+ fd = 0; // stdin
else {
fd = open(file, O_RDONLY);
if(fd == -1) {