libgnt/libgnt

Remove C99-obsoleted constructs

17 months ago, Elliott Sales de Andrade
f5126e6837e3
Parents b7174f76d7ee
Children 53e8b422faaf
Remove C99-obsoleted constructs

See [this development thread for a future Fedora change](https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org/thread/CJXKTLXJUPZ4F2C2VQOTNMEA5JAUPMBD/) or [the proposed change page](https://fedoraproject.org/wiki/Changes/PortingToModernC). These may be made stronger errors in GCC 14.

Testing Done:
Configured with `-Dc_args='-Werror=implicit-int -Werror=implicit-function-declaration -Werror=int-conversion -Werror=strict-prototypes -Werror=old-style-definition'` and compiled.

Reviewed at https://reviews.imfreedom.org/r/1973/
  • +2 -1
    gnt-skel.c
  • +3 -2
    gntcolors.c
  • +2 -1
    gntcombobox.c
  • +4 -2
    gntkeys.c
  • +15 -8
    gntmain.c
  • +4 -2
    gntstyle.c
  • +2 -1
    gnttextview.c
  • +2 -1
    gnttree.c
  • +2 -1
    gntwindow.c
  • +2 -1
    test.c
  • +2 -1
    test/file.c
  • +2 -1
    test/key.c
  • +2 -1
    test/parse.c
  • +1 -1
    test/wm.c
  • --- a/gnt-skel.c Tue Aug 16 00:57:30 2022 -0500
    +++ b/gnt-skel.c Wed Oct 26 02:55:48 2022 -0500
    @@ -100,7 +100,8 @@
    /******************************************************************************
    * GntSkel API
    *****************************************************************************/
    -GntWidget *gnt_skel_new()
    +GntWidget *
    +gnt_skel_new(void)
    {
    GntWidget *widget = g_object_new(GNT_TYPE_SKEL, NULL);
    GntSkel *skel = GNT_SKEL(widget);
    --- a/gntcolors.c Tue Aug 16 00:57:30 2022 -0500
    +++ b/gntcolors.c Wed Oct 26 02:55:48 2022 -0500
    @@ -67,7 +67,8 @@
    }
    }
    -void gnt_init_colors()
    +void
    +gnt_init_colors(void)
    {
    static gboolean init = FALSE;
    int defaults;
    @@ -131,7 +132,7 @@
    }
    void
    -gnt_uninit_colors()
    +gnt_uninit_colors(void)
    {
    if (can_use_custom_color())
    restore_colors();
    --- a/gntcombobox.c Tue Aug 16 00:57:30 2022 -0500
    +++ b/gntcombobox.c Wed Oct 26 02:55:48 2022 -0500
    @@ -355,7 +355,8 @@
    /******************************************************************************
    * GntComboBox API
    *****************************************************************************/
    -GntWidget *gnt_combo_box_new()
    +GntWidget *
    +gnt_combo_box_new(void)
    {
    GntWidget *widget = g_object_new(GNT_TYPE_COMBO_BOX, NULL);
    --- a/gntkeys.c Tue Aug 16 00:57:30 2022 -0500
    +++ b/gntkeys.c Wed Oct 26 02:55:48 2022 -0500
    @@ -37,7 +37,8 @@
    static const char *term;
    static GHashTable *specials;
    -void gnt_init_keys()
    +void
    +gnt_init_keys(void)
    {
    const char *controls[] = {"", "c-", "ctrl-", "ctr-", "ctl-", NULL};
    const char *alts[] = {"", "alt-", "a-", "m-", "meta-", NULL};
    @@ -301,7 +302,8 @@
    /* this is purely for debugging purposes. */
    void gnt_keys_print_combinations(void);
    -void gnt_keys_print_combinations()
    +void
    +gnt_keys_print_combinations(void)
    {
    g_printerr("--------\n");
    print_path(&root, 1);
    --- a/gntmain.c Tue Aug 16 00:57:30 2022 -0500
    +++ b/gntmain.c Wed Oct 26 02:55:48 2022 -0500
    @@ -439,7 +439,7 @@
    }
    static void
    -setup_io()
    +setup_io(void)
    {
    guint result;
    @@ -616,7 +616,8 @@
    wm = g_object_new(GNT_TYPE_WM, NULL);
    }
    -void gnt_init()
    +void
    +gnt_init(void)
    {
    char *filename;
    const char *locale;
    @@ -708,7 +709,8 @@
    clipboard = g_object_new(GNT_TYPE_CLIPBOARD, NULL);
    }
    -void gnt_main()
    +void
    +gnt_main(void)
    {
    GMainLoop *loop = g_main_loop_new(NULL, FALSE);
    gnt_wm_set_mainloop(wm, loop);
    @@ -782,7 +784,8 @@
    gnt_wm_update_window(wm, widget);
    }
    -void gnt_quit()
    +void
    +gnt_quit(void)
    {
    /* Prevent io_invoke() from being called after wm is destroyed */
    if (channel_error_callback) {
    @@ -807,7 +810,8 @@
    g_clear_pointer(&custom_config_dir, g_free);
    }
    -gboolean gnt_ascii_only()
    +gboolean
    +gnt_ascii_only(void)
    {
    return ascii_only;
    }
    @@ -869,12 +873,14 @@
    gnt_clipboard_set_string(clipboard, string);
    }
    -GntClipboard *gnt_get_clipboard()
    +GntClipboard *
    +gnt_get_clipboard(void)
    {
    return clipboard;
    }
    -gchar *gnt_get_clipboard_string()
    +gchar *
    +gnt_get_clipboard_string(void)
    {
    return gnt_clipboard_get_string(clipboard);
    }
    @@ -927,7 +933,8 @@
    return TRUE;
    }
    -gboolean gnt_is_refugee()
    +gboolean
    +gnt_is_refugee(void)
    {
    return (wm &&
    gnt_wm_get_keypress_mode(wm) == GNT_KP_MODE_WAIT_ON_CHILD);
    --- a/gntstyle.c Tue Aug 16 00:57:30 2022 -0500
    +++ b/gntstyle.c Wed Oct 26 02:55:48 2022 -0500
    @@ -423,7 +423,8 @@
    read_general_style(gkfile);
    }
    -void gnt_init_styles()
    +void
    +gnt_init_styles(void)
    {
    int i;
    for (i = 0; i < GNT_STYLES; i++)
    @@ -434,7 +435,8 @@
    }
    }
    -void gnt_uninit_styles()
    +void
    +gnt_uninit_styles(void)
    {
    int i;
    for (i = 0; i < GNT_STYLES; i++) {
    --- a/gnttextview.c Tue Aug 16 00:57:30 2022 -0500
    +++ b/gnttextview.c Wed Oct 26 02:55:48 2022 -0500
    @@ -496,7 +496,8 @@
    /******************************************************************************
    * GntTextView API
    *****************************************************************************/
    -GntWidget *gnt_text_view_new()
    +GntWidget *
    +gnt_text_view_new(void)
    {
    GntWidget *widget = g_object_new(GNT_TYPE_TEXT_VIEW, NULL);
    --- a/gnttree.c Tue Aug 16 00:57:30 2022 -0500
    +++ b/gnttree.c Wed Oct 26 02:55:48 2022 -0500
    @@ -1272,7 +1272,8 @@
    g_free(row);
    }
    -GntWidget *gnt_tree_new()
    +GntWidget *
    +gnt_tree_new(void)
    {
    return gnt_tree_new_with_columns(1);
    }
    --- a/gntwindow.c Tue Aug 16 00:57:30 2022 -0500
    +++ b/gntwindow.c Wed Oct 26 02:55:48 2022 -0500
    @@ -125,7 +125,8 @@
    /******************************************************************************
    * GntWindow API
    *****************************************************************************/
    -GntWidget *gnt_window_new()
    +GntWidget *
    +gnt_window_new(void)
    {
    GntWidget *widget = g_object_new(GNT_TYPE_WINDOW, NULL);
    --- a/test.c Tue Aug 16 00:57:30 2022 -0500
    +++ b/test.c Wed Oct 26 02:55:48 2022 -0500
    @@ -42,7 +42,8 @@
    return TRUE;
    }
    -int main()
    +int
    +main(void)
    {
    gnt_init();
    --- a/test/file.c Tue Aug 16 00:57:30 2022 -0500
    +++ b/test/file.c Wed Oct 26 02:55:48 2022 -0500
    @@ -6,7 +6,8 @@
    g_printerr("%s %s\n", path, filename);
    }
    -int main()
    +int
    +main(void)
    {
    freopen(".error", "w", stderr);
    fprintf(stdout, "\x1b]1;\x07\x1b]2;TEST\x07");
    --- a/test/key.c Tue Aug 16 00:57:30 2022 -0500
    +++ b/test/key.c Wed Oct 26 02:55:48 2022 -0500
    @@ -1,6 +1,7 @@
    #include <ncurses.h>
    -int main()
    +int
    +main(void)
    {
    int ch;
    --- a/test/parse.c Tue Aug 16 00:57:30 2022 -0500
    +++ b/test/parse.c Wed Oct 26 02:55:48 2022 -0500
    @@ -1,6 +1,7 @@
    #include <gnt.h>
    -int main()
    +int
    +main(void)
    {
    GntWidget *win, *button;
    --- a/test/wm.c Tue Aug 16 00:57:30 2022 -0500
    +++ b/test/wm.c Wed Oct 26 02:55:48 2022 -0500
    @@ -11,7 +11,7 @@
    {
    const char *cmd;
    void *handle;
    - void (*func)();
    + void (*func)(int, char**);
    cmd = gnt_entry_get_text(entry);
    handle = g_module_open(cmd, G_MODULE_BIND_LOCAL);