qulogic/libgnt

Backport more warning fixes for Pidgin and Finch from default
release-2.x.y
2014-05-06, Tomasz Wasilczyk
5eb75f6413f5
Backport more warning fixes for Pidgin and Finch from default
  • +3 -0
    gntmain.c
  • +10 -6
    gntwm.c
  • --- a/gntmain.c Thu Feb 13 20:33:18 2014 -0500
    +++ b/gntmain.c Tue May 06 15:17:11 2014 +0200
    @@ -508,7 +508,10 @@
    signal(SIGINT, sighandler);
    signal(SIGPIPE, SIG_IGN);
    +#if !GLIB_CHECK_VERSION(2, 36, 0)
    + /* GLib type system is automaticaly initialized since 2.36. */
    g_type_init();
    +#endif
    init_wm();
    --- a/gntwm.c Thu Feb 13 20:33:18 2014 -0500
    +++ b/gntwm.c Tue May 06 15:17:11 2014 +0200
    @@ -776,14 +776,16 @@
    if ((now & A_COLOR) != (old & A_COLOR) ||
    (now & A_REVERSE) != (old & A_REVERSE))
    {
    - int ret;
    short fgp, bgp, r, g, b;
    struct
    {
    int r, g, b;
    } fg, bg;
    - ret = pair_content(PAIR_NUMBER(now & A_COLOR), &fgp, &bgp);
    + if (pair_content(PAIR_NUMBER(now & A_COLOR), &fgp, &bgp) != OK) {
    + fgp = -1;
    + bgp = -1;
    + }
    if (fgp == -1)
    fgp = COLOR_BLACK;
    if (bgp == -1)
    @@ -794,9 +796,13 @@
    fgp = bgp;
    bgp = tmp;
    }
    - ret = color_content(fgp, &r, &g, &b);
    + if (color_content(fgp, &r, &g, &b) != OK) {
    + r = g = b = 0;
    + }
    fg.r = r; fg.b = b; fg.g = g;
    - ret = color_content(bgp, &r, &g, &b);
    + if (color_content(bgp, &r, &g, &b) != OK) {
    + r = g = b = 255;
    + }
    bg.r = r; bg.b = b; bg.g = g;
    #define ADJUST(x) (x = x * 255 / 1000)
    ADJUST(fg.r);
    @@ -1144,13 +1150,11 @@
    {
    static GntWidget *clip;
    gchar *text;
    - int maxx, maxy;
    if (clip) {
    gnt_widget_destroy(clip);
    clip = NULL;
    return TRUE;
    }
    - getmaxyx(stdscr, maxy, maxx);
    text = gnt_get_clipboard_string();
    clip = gnt_hwindow_new(FALSE);
    GNT_WIDGET_SET_FLAGS(clip, GNT_WIDGET_TRANSIENT);