--- a/convey.yml Mon Oct 07 02:32:27 2019 -0400
+++ b/convey.yml Wed Oct 09 02:38:18 2019 +0000
@@ -1,7 +1,9 @@
- - DOCS_TAG=libgnt/docs:${GNT_VERSION}
+ - DOCS_REPOSITORY=libgnt/docs + - REGISTRY_HOST=docker.io + - REPOSITORY=libgnt/builders @@ -21,10 +23,11 @@
- image: libgnt/builders:debian-buster-amd64
+ image: ${REGISTRY_HOST}/${REPOSITORY}:debian-buster-amd64 @@ -33,12 +36,20 @@
dockerfile: doc/Dockerfile
+ tag: ${REGISTRY_HOST}/${DOCS_REPOSITORY}:${GNT_VERSION} - build-convey/doc/html:.
+ image: ${REGISTRY_HOST}/${DOCS_REPOSITORY}:${GNT_VERSION} + image: ${REGISTRY_HOST}/${REPOSITORY}:${TARGET} @@ -67,3 +78,10 @@
+ environment: [TARGET=pvs-studio, PVS_STUDIO_KEY, PVS_STUDIO_USERNAME] + - tasks: [import, build-target] + - tasks: [export-target] --- a/gntentry.c Mon Oct 07 02:32:27 2019 -0400
+++ b/gntentry.c Wed Oct 09 02:38:18 2019 +0000
@@ -1058,7 +1058,7 @@
GntBindableClass *bindable = GNT_BINDABLE_CLASS(klass);
GntWidgetClass *widget_class = GNT_WIDGET_CLASS(klass);
- char s[3] = {'\033', erasechar(), 0};
+ char s[3] = {GNT_ESCAPE, erasechar(), 0}; widget_class->clicked = gnt_entry_clicked;
widget_class->destroy = gnt_entry_destroy;
--- a/gntinternal.h Mon Oct 07 02:32:27 2019 -0400
+++ b/gntinternal.h Wed Oct 09 02:38:18 2019 +0000
@@ -26,6 +26,8 @@
#define G_LOG_DOMAIN "Gnt"
+#define GNT_ESCAPE '\033' # define GNT_LOG_DOMAIN ""
--- a/gntmain.c Mon Oct 07 02:32:27 2019 -0400
+++ b/gntmain.c Wed Oct 09 02:38:18 2019 +0000
@@ -93,7 +93,7 @@
static gboolean refresh_screen(void);
+static GntWM *wm; // -V707 static GntClipboard *clipboard;
int gnt_need_conversation_to_locale;
@@ -315,7 +315,7 @@
@@ -328,7 +328,7 @@
if (ch == 0xE0 || ch == 0xE1) {
@@ -397,7 +397,7 @@
g_source_remove(escape_stuff.timer);
@@ -413,7 +413,7 @@
- if (k[0] == '\033' && rd == 1) {
+ if (k[0] == GNT_ESCAPE && rd == 1) { escape_stuff.timer = g_timeout_add(250, escape_timeout, NULL);
@@ -924,24 +924,39 @@
gnt_wm_get_keypress_mode(wm) == GNT_KP_MODE_WAIT_ON_CHILD);
+/* to save other's time... this ugly function converts the given string to the + * locale if necessary and returns it as a const gchar *. Since it needs to + * return a const gchar * there's a bunch of messing around with a static + * variable. While this works, this makes this non-thread safe and who knows const char *C_(const char *x)
+ static gchar *c = NULL; + /* clear the old value we had for cm since it's no longer needed */ if (gnt_need_conversation_to_locale) {
- c = g_locale_from_utf8(x, -1, NULL, NULL, &error);
- if (c == NULL || error) {
- gnt_warning("Error: %s\n", error ? error->message : "(unknown)");
+ newc = g_locale_from_utf8(x, -1, NULL, NULL, &error); + gnt_warning("Error: %s\n", error->message ? error->message : "(unknown)");
--- a/gntstyle.c Mon Oct 07 02:32:27 2019 -0400
+++ b/gntstyle.c Wed Oct 09 02:38:18 2019 +0000
@@ -136,7 +136,7 @@
if (*s == '^' && *(s + 1) == '[')
- *t = '\033'; /* escape */
--- a/gnttextview.c Mon Oct 07 02:32:27 2019 -0400
+++ b/gnttextview.c Wed Oct 09 02:38:18 2019 +0000
@@ -161,7 +161,7 @@
- if (has_scroll && rows > 0)
+ if (has_scroll && rows > 0 && lines != NULL) int total = g_list_length(g_list_first(view->list));
int showing, position, up, down;
@@ -174,14 +174,14 @@
position = (rows - showing) * up / MAX(1, up + down);
- position = MAX((lines != NULL), position);
+ position = MAX(1, position); if (showing + position > rows)
position = rows - showing;
- if (showing + position == rows && view->list && view->list->prev)
+ if (showing + position == rows && view->list->prev) position = MAX(1, rows - 1 - showing);
- else if (showing + position < rows && view->list && !view->list->prev)
+ else if (showing + position < rows && !view->list->prev) position = rows - showing;
mvwvline(window, position + 1, scrcol,
@@ -650,7 +650,8 @@
GList *list = view->list;
view->list = g_list_prepend(g_list_first(view->list), line);
+ view->list = list; // -V519 gnt_widget_draw(GNT_WIDGET(view));
--- a/gntwm.c Mon Oct 07 02:32:27 2019 -0400
+++ b/gntwm.c Wed Oct 09 02:38:18 2019 +0000
@@ -216,7 +216,6 @@
while ((panel = panel_below(panel)) != NULL) {
int sx, ex, sy, ey, w, y;
sx = getbegx(panel_window(panel));
@@ -232,6 +231,8 @@
ex < getbegx(panel_window(below)))
for (y = MAX(sy, getbegy(panel_window(below))); y <= MIN(ey, getbegy(panel_window(below)) + getmaxy(panel_window(below))); y++) {
+ memset(&ch, 0, sizeof(ch)); if (mvwin_wch(panel_window(below), y - getbegy(panel_window(below)), sx - 1 - getbegx(panel_window(below)), &ch) != OK)
w = widestringwidth(ch.chars);
@@ -826,6 +827,7 @@
+ memset(&wch, 0, sizeof(wch)); mvwin_wch(curscr, y, x, &wch);
ch[0] = (char)(wch.chars[0] & 0xff);
@@ -1079,15 +1081,21 @@
widestringwidth(wchar_t *wide)
len = wcstombs(NULL, wide, 0) + 1;
- string = g_new0(char, len);
- wcstombs(string, wide, len);
- ret = string ? gnt_util_onscreen_width(string, NULL) : 1;
+ str = g_new0(char, len); + wcstombs(str, wide, len); + ret = gnt_util_onscreen_width(str, NULL); @@ -2191,7 +2199,7 @@
gnt_widget_destroy(priv->list.window);
- } else if (keys[0] == '\033' && isdigit(keys[1]) && keys[2] == '\0') {
+ } else if (keys[0] == GNT_ESCAPE && isdigit(keys[1]) && keys[2] == '\0') { /* Alt+x for quick switch */
int n = *(keys + 1) - '0';
--- a/wms/irssi.c Mon Oct 07 02:32:27 2019 -0400
+++ b/wms/irssi.c Wed Oct 09 02:38:18 2019 +0000
@@ -161,7 +161,7 @@
name = gnt_widget_get_name(win);
if (!name || !strstr(name, "conversation-window")) {
if (!GNT_IS_MENU(win) && !gnt_widget_get_transient(win)) {
- if ((!name || strcmp(name, "buddylist"))) {
+ if (!name || strcmp(name, "buddylist")) { gnt_widget_get_size(win, &w, &h);
x = (getmaxx(stdscr) - w) / 2;
y = (getmaxy(stdscr) - h) / 2;