diff options
author | John Hernandez <129467592+H3rnand3zzz@users.noreply.github.com> | 2023-04-19 02:44:19 +0200 |
---|---|---|
committer | John Hernandez <129467592+H3rnand3zzz@users.noreply.github.com> | 2023-05-04 16:15:09 +0200 |
commit | 7f3fca2bd081a729d425184f7a0484025862257e (patch) | |
tree | 20f1cd78bf48f7d6ceb95bb0262faf691001bcf9 /src/command | |
parent | faccf24c759d7bddb4d3062c7f044e0c7640ffe7 (diff) | |
download | profani-tty-7f3fca2bd081a729d425184f7a0484025862257e.tar.gz |
Cleanup: gchar as gchar instead of char
Use gchar instead of char in most of the cases where gchar is intended. Reason: improve compatibility and stability. Issue #1819 Minor refactoring.
Diffstat (limited to 'src/command')
-rw-r--r-- | src/command/cmd_ac.c | 10 | ||||
-rw-r--r-- | src/command/cmd_funcs.c | 3 |
2 files changed, 5 insertions, 8 deletions
diff --git a/src/command/cmd_ac.c b/src/command/cmd_ac.c index deda8abe..765ef448 100644 --- a/src/command/cmd_ac.c +++ b/src/command/cmd_ac.c @@ -125,7 +125,7 @@ static char* _logging_autocomplete(ProfWin* window, const char* const input, gbo static char* _color_autocomplete(ProfWin* window, const char* const input, gboolean previous); static char* _avatar_autocomplete(ProfWin* window, const char* const input, gboolean previous); static char* _correction_autocomplete(ProfWin* window, const char* const input, gboolean previous); -static char* _correct_autocomplete(ProfWin* window, const char* const input, gboolean previous); +static gchar* _correct_autocomplete(ProfWin* window, const char* const input, gboolean previous); static char* _software_autocomplete(ProfWin* window, const char* const input, gboolean previous); static char* _url_autocomplete(ProfWin* window, const char* const input, gboolean previous); static char* _executable_autocomplete(ProfWin* window, const char* const input, gboolean previous); @@ -4291,17 +4291,15 @@ _avatar_autocomplete(ProfWin* window, const char* const input, gboolean previous static char* _correction_autocomplete(ProfWin* window, const char* const input, gboolean previous) { - char* result = NULL; - - result = autocomplete_param_with_ac(input, "/correction", correction_ac, TRUE, previous); + char* result = autocomplete_param_with_ac(input, "/correction", correction_ac, TRUE, previous); return result; } -static char* +static gchar* _correct_autocomplete(ProfWin* window, const char* const input, gboolean previous) { - char* result = g_strdup_printf("/correct %s", win_get_last_sent_message(window)); + gchar* result = g_strdup_printf("/correct %s", win_get_last_sent_message(window)); return result; } diff --git a/src/command/cmd_funcs.c b/src/command/cmd_funcs.c index 6e9ca259..83c594f5 100644 --- a/src/command/cmd_funcs.c +++ b/src/command/cmd_funcs.c @@ -9703,9 +9703,8 @@ cmd_executable_vcard_photo(ProfWin* window, const char* const command, gchar** a cons_show("`vcard photo open` command set to invoke '%s'", args[2]); } else if (g_strcmp0(args[1], "default") == 0) { prefs_set_string(PREF_VCARD_PHOTO_CMD, NULL); - char* cmd = prefs_get_string(PREF_VCARD_PHOTO_CMD); + auto_gchar gchar* cmd = prefs_get_string(PREF_VCARD_PHOTO_CMD); cons_show("`vcard photo open` command set to invoke '%s' (default)", cmd); - g_free(cmd); } else { cons_bad_cmd_usage(command); } |