summaryrefslogtreecommitdiff
path: root/src/libvterm
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2019-12-04 22:16:54 +0100
committerBram Moolenaar <Bram@vim.org>2019-12-04 22:16:54 +0100
commit707d226ac58da752ecc6b7620055fb1df3957a27 (patch)
tree6b95e780f80d2ef0dbfb5e246935692d6ffe22b4 /src/libvterm
parent4ba37b5833de99db9e9afe8928b31c864182405c (diff)
downloadvim-git-707d226ac58da752ecc6b7620055fb1df3957a27.tar.gz
patch 8.1.2389: using old C style commentsv8.1.2389
Problem: Using old C style comments. Solution: Use // comments where appropriate.
Diffstat (limited to 'src/libvterm')
-rw-r--r--src/libvterm/include/vterm.h17
-rw-r--r--src/libvterm/src/screen.c8
-rw-r--r--src/libvterm/src/unicode.c6
-rw-r--r--src/libvterm/src/vterm.c6
-rw-r--r--src/libvterm/t/harness.c67
5 files changed, 52 insertions, 52 deletions
diff --git a/src/libvterm/include/vterm.h b/src/libvterm/include/vterm.h
index 28d0a10f5..0238226fb 100644
--- a/src/libvterm/include/vterm.h
+++ b/src/libvterm/include/vterm.h
@@ -216,14 +216,13 @@ void vterm_mouse_button(VTerm *vt, int button, int pressed, VTermModifier mod);
// Parser layer
// ------------
-/* Flag to indicate non-final subparameters in a single CSI parameter.
- * Consider
- * CSI 1;2:3:4;5a
- * 1 4 and 5 are final.
- * 2 and 3 are non-final and will have this bit set
- *
- * Don't confuse this with the final byte of the CSI escape; 'a' in this case.
- */
+// Flag to indicate non-final subparameters in a single CSI parameter.
+// Consider
+// CSI 1;2:3:4;5a
+// 1 4 and 5 are final.
+// 2 and 3 are non-final and will have this bit set
+//
+// Don't confuse this with the final byte of the CSI escape; 'a' in this case.
#define CSI_ARG_FLAG_MORE (1U<<31)
#define CSI_ARG_MASK (~(1U<<31))
@@ -357,7 +356,7 @@ VTermScreen *vterm_obtain_screen(VTerm *vt);
void vterm_screen_set_callbacks(VTermScreen *screen, const VTermScreenCallbacks *callbacks, void *user);
void *vterm_screen_get_cbdata(VTermScreen *screen);
-/* Only invokes control, csi, osc, dcs */
+// Only invokes control, csi, osc, dcs
void vterm_screen_set_unrecognised_fallbacks(VTermScreen *screen, const VTermParserCallbacks *fallbacks, void *user);
void *vterm_screen_get_unrecognised_fbdata(VTermScreen *screen);
diff --git a/src/libvterm/src/screen.c b/src/libvterm/src/screen.c
index 6ad0e1afd..bf2383a1c 100644
--- a/src/libvterm/src/screen.c
+++ b/src/libvterm/src/screen.c
@@ -773,7 +773,7 @@ int vterm_screen_get_cell(const VTermScreen *screen, VTermPos pos, VTermScreenCe
cell->bg = intcell->pen.bg;
if(vterm_get_special_pty_type() == 2) {
- /* Get correct cell width from cell information contained in line buffer */
+ // Get correct cell width from cell information contained in line buffer
if(pos.col < (screen->cols - 1) &&
getcell(screen, pos.row, pos.col + 1)->chars[0] == (uint32_t)-1) {
if(getcell(screen, pos.row, pos.col)->chars[0] == 0x20) {
@@ -798,8 +798,10 @@ int vterm_screen_get_cell(const VTermScreen *screen, VTermPos pos, VTermScreenCe
return 1;
}
-// Copy external to internal representation of a screen cell
-/* static because it's only used internally for sb_popline during resize */
+/*
+ * Copy external to internal representation of a screen cell
+ * static because it's only used internally for sb_popline during resize
+ */
static int vterm_screen_set_cell(VTermScreen *screen, VTermPos pos, const VTermScreenCell *cell)
{
ScreenCell *intcell = getcell(screen, pos.row, pos.col);
diff --git a/src/libvterm/src/unicode.c b/src/libvterm/src/unicode.c
index 7f93763aa..424b3e206 100644
--- a/src/libvterm/src/unicode.c
+++ b/src/libvterm/src/unicode.c
@@ -452,7 +452,7 @@ static int mk_wcwidth(uint32_t ucs)
}
#endif
-#if 0 /* unused */
+#if 0 // unused
static int mk_wcswidth(const uint32_t *pwcs, size_t n)
{
int w, width = 0;
@@ -479,8 +479,8 @@ static int mk_wcswidth(const uint32_t *pwcs, size_t n)
static int mk_wcwidth_cjk(uint32_t ucs)
{
#endif
- /* sorted list of non-overlapping intervals of East Asian Ambiguous
- * characters, generated by "uniset +WIDTH-A -cat=Me -cat=Mn -cat=Cf c" */
+ // sorted list of non-overlapping intervals of East Asian Ambiguous
+ // characters, generated by "uniset +WIDTH-A -cat=Me -cat=Mn -cat=Cf c"
static const struct interval ambiguous[] = {
{ 0x00A1, 0x00A1 }, { 0x00A4, 0x00A4 }, { 0x00A7, 0x00A8 },
{ 0x00AA, 0x00AA }, { 0x00AE, 0x00AE }, { 0x00B0, 0x00B4 },
diff --git a/src/libvterm/src/vterm.c b/src/libvterm/src/vterm.c
index d17f06c08..1d6a977f1 100644
--- a/src/libvterm/src/vterm.c
+++ b/src/libvterm/src/vterm.c
@@ -10,9 +10,9 @@
#include "utf8.h"
-/*****************
- * API functions *
- *****************/
+///////////////////
+// API functions //
+///////////////////
static void *default_malloc(size_t size, void *allocdata UNUSED)
{
diff --git a/src/libvterm/t/harness.c b/src/libvterm/t/harness.c
index e2c729555..ccb2b39f5 100644
--- a/src/libvterm/t/harness.c
+++ b/src/libvterm/t/harness.c
@@ -1,5 +1,5 @@
#include "vterm.h"
-#include "../src/vterm_internal.h" /* We pull in some internal bits too */
+#include "../src/vterm_internal.h" // We pull in some internal bits too
#include <stdio.h>
#include <string.h>
@@ -163,16 +163,16 @@ static int parser_dcs(const char *command, size_t cmdlen, void *user)
}
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
};
-/* These callbacks are shared by State and Screen */
+// These callbacks are shared by State and Screen
static int want_movecursor = 0;
static VTermPos state_pos;
@@ -241,7 +241,7 @@ static int settermprop(VTermProp prop, VTermValue *val, void *user)
return 0;
}
-/* These callbacks are for State */
+// These callbacks are for State
static int want_state_putglyph = 0;
static int state_putglyph(VTermGlyphInfo *info, VTermPos pos, void *user)
@@ -333,17 +333,17 @@ static int state_setlineinfo(int row, const VTermLineInfo *newinfo, const VTermL
}
VTermStateCallbacks state_cbs = {
- state_putglyph, /* putglyph */
- movecursor, /* movecursor */
- scrollrect, /* scrollrect */
- moverect, /* moverect */
- state_erase, /* erase */
- NULL, /* initpen */
- state_setpenattr, /* setpenattr */
- settermprop, /* settermprop */
- NULL, /* bell */
- NULL, /* resize */
- state_setlineinfo, /* setlineinfo */
+ state_putglyph, // putglyph
+ movecursor, // movecursor
+ scrollrect, // scrollrect
+ moverect, // moverect
+ state_erase, // erase
+ NULL, // initpen
+ state_setpenattr, // setpenattr
+ settermprop, // settermprop
+ NULL, // bell
+ NULL, // resize
+ state_setlineinfo, // setlineinfo
};
static int want_screen_damage = 0;
@@ -427,7 +427,7 @@ static int screen_sb_popline(int cols, VTermScreenCell *cells, void *user)
if(!want_screen_scrollback)
return 0;
- /* All lines of scrollback contain "ABCDE" */
+ // All lines of scrollback contain "ABCDE"
for(col = 0; col < cols; col++) {
if(col < 5)
cells[col].chars[0] = 'A' + col;
@@ -442,14 +442,14 @@ static int screen_sb_popline(int cols, VTermScreenCell *cells, void *user)
}
VTermScreenCallbacks screen_cbs = {
- screen_damage, /* damage */
- moverect, /* moverect */
- movecursor, /* movecursor */
- settermprop, /* settermprop */
- NULL, /* bell */
- NULL, /* resize */
- screen_sb_pushline, /* sb_pushline */
- screen_sb_popline /* sb_popline */
+ screen_damage, // damage
+ moverect, // moverect
+ movecursor, // movecursor
+ settermprop, // settermprop
+ NULL, // bell
+ NULL, // resize
+ screen_sb_pushline, // sb_pushline
+ screen_sb_popline // sb_popline
};
int main(int argc, char **argv)
@@ -592,9 +592,8 @@ int main(int argc, char **argv)
}
else if(streq(line, "WANTENCODING")) {
- /* This isn't really external API but it's hard to get this out any
- * other way
- */
+ // This isn't really external API but it's hard to get this out any
+ // other way
encoding.enc = vterm_lookup_encoding(ENC_UTF8, 'u');
if(encoding.enc->init)
(*encoding.enc->init)(encoding.enc, encoding.data);
@@ -833,7 +832,7 @@ int main(int argc, char **argv)
else if(len == 0)
printf("\n");
else {
- /* Put an overwrite guard at both ends of the buffer */
+ // Put an overwrite guard at both ends of the buffer
unsigned char *buffer = malloc(len + 4);
unsigned char *text = buffer + 2;
text[-2] = 0x55; text[-1] = 0xAA;