qulogic/libgnt

Merged soc.2013.gobjectification branch
soc.2013.gobjectification.plugins
2013-08-23, Ankit Vani
8c9258477ece
Merged soc.2013.gobjectification branch
  • +1 -1
    gntcolors.c
  • +7 -4
    gntentry.c
  • +1 -1
    gntentry.h
  • +5 -4
    gntmenu.c
  • +1 -1
    gntmenu.h
  • +1 -1
    gntstyle.c
  • +1 -1
    gnttextview.c
  • +2 -1
    gntwm.c
  • --- a/gntcolors.c Tue Aug 13 20:49:55 2013 +0530
    +++ b/gntcolors.c Fri Aug 23 23:46:41 2013 +0530
    @@ -296,7 +296,7 @@
    {
    return (hascolors ? COLOR_PAIR(pair) :
    ((pair == GNT_COLOR_NORMAL || pair == GNT_COLOR_HIGHLIGHT_D ||
    - pair == GNT_COLOR_TITLE_D || pair == GNT_COLOR_DISABLED) ? 0 : A_STANDOUT));
    + pair == GNT_COLOR_TITLE_D || pair == GNT_COLOR_DISABLED) ? 0 : (int)A_STANDOUT));
    }
    int gnt_color_add_pair(int fg, int bg)
    --- a/gntentry.c Tue Aug 13 20:49:55 2013 +0530
    +++ b/gntentry.c Fri Aug 23 23:46:41 2013 +0530
    @@ -184,7 +184,7 @@
    show_suggest_dropdown(GntEntry *entry)
    {
    char *suggest = NULL;
    - int len;
    + gsize len;
    int offset = 0, x, y;
    int count = 0;
    GList *iter;
    @@ -815,7 +815,7 @@
    for (str = text; *str; str = next)
    {
    - int len;
    + gsize len;
    next = g_utf8_find_next_char(str, NULL);
    len = next - str;
    @@ -834,7 +834,7 @@
    if (entry->max && g_utf8_pointer_to_offset(entry->start, entry->end) >= entry->max)
    continue;
    - if (entry->end + len - entry->start >= entry->buffer)
    + if ((gsize)(entry->end + len - entry->start) >= entry->buffer)
    {
    /* This will cause the buffer to grow */
    char *tmp = g_strdup(entry->start);
    @@ -1184,8 +1184,11 @@
    {
    g_return_if_fail(entry->history != NULL); /* Need to set_history_length first */
    - if (g_list_length(entry->history) >= entry->histlength)
    + if (entry->histlength >= 0 &&
    + g_list_length(entry->history) >= (gsize)entry->histlength)
    + {
    return;
    + }
    entry->history = g_list_first(entry->history);
    g_free(entry->history->data);
    --- a/gntentry.h Tue Aug 13 20:49:55 2013 +0530
    +++ b/gntentry.h Fri Aug 23 23:46:41 2013 +0530
    @@ -178,7 +178,7 @@
    * Set the length of history for the entry box.
    *
    * @param entry The entry box.
    - * @param num The maximum length of the history.
    + * @param num The maximum length of the history, -1 for unlimited.
    */
    void gnt_entry_set_history_length(GntEntry *entry, int num);
    --- a/gntmenu.c Tue Aug 13 20:49:55 2013 +0530
    +++ b/gntmenu.c Fri Aug 23 23:46:41 2013 +0530
    @@ -79,7 +79,7 @@
    GntMenu *menu = GNT_MENU(widget);
    GList *iter;
    chtype type;
    - int i;
    + guint i;
    if (menu->type == GNT_MENU_TOPLEVEL) {
    wbkgdset(widget->window, '\0' | gnt_color_pair(GNT_COLOR_HIGHLIGHT));
    @@ -277,7 +277,7 @@
    gnt_menu_key_pressed(GntWidget *widget, const char *text)
    {
    GntMenu *menu = GNT_MENU(widget);
    - int current = menu->selected;
    + guint current = menu->selected;
    if (menu->submenu) {
    GntMenu *sub = menu;
    @@ -304,9 +304,10 @@
    if (menu->type == GNT_MENU_TOPLEVEL) {
    if (strcmp(text, GNT_KEY_LEFT) == 0) {
    - menu->selected--;
    - if (menu->selected < 0)
    + if (menu->selected == 0)
    menu->selected = g_list_length(menu->list) - 1;
    + else
    + menu->selected--;
    } else if (strcmp(text, GNT_KEY_RIGHT) == 0) {
    menu->selected++;
    if (menu->selected >= g_list_length(menu->list))
    --- a/gntmenu.h Tue Aug 13 20:49:55 2013 +0530
    +++ b/gntmenu.h Fri Aug 23 23:46:41 2013 +0530
    @@ -65,7 +65,7 @@
    GntMenuType type;
    GList *list;
    - int selected;
    + guint selected;
    /* This will keep track of its immediate submenu which is visible so that
    * keystrokes can be passed to it. */
    --- a/gntstyle.c Tue Aug 13 20:49:55 2013 +0530
    +++ b/gntstyle.c Fri Aug 23 23:46:41 2013 +0530
    @@ -168,7 +168,7 @@
    gsize c;
    for (i = 1; i < MAX_WORKSPACES; ++i) {
    - int j;
    + gsize j;
    GntWS *ws;
    gchar **titles;
    char group[32];
    --- a/gnttextview.c Tue Aug 13 20:49:55 2013 +0530
    +++ b/gnttextview.c Fri Aug 23 23:46:41 2013 +0530
    @@ -513,7 +513,7 @@
    GntTextFormatFlags flags, const char *tagname)
    {
    GntWidget *widget = GNT_WIDGET(view);
    - int fl = 0;
    + chtype fl = 0;
    const char *start, *end;
    GList *list = view->list;
    GntTextLine *line;
    --- a/gntwm.c Tue Aug 13 20:49:55 2013 +0530
    +++ b/gntwm.c Fri Aug 23 23:46:41 2013 +0530
    @@ -427,6 +427,7 @@
    w = wm->cws->ordered->data;
    orgpos = pos = g_list_index(wm->cws->list, w);
    + g_return_if_fail(pos < 0);
    do {
    pos += direction;
    @@ -434,7 +435,7 @@
    if (pos < 0) {
    wid = g_list_last(wm->cws->list)->data;
    pos = g_list_length(wm->cws->list) - 1;
    - } else if (pos >= g_list_length(wm->cws->list)) {
    + } else if ((guint)pos >= g_list_length(wm->cws->list)) {
    wid = wm->cws->list->data;
    pos = 0;
    } else