[geany/geany-plugins] a5dfaa: scope: small code cleanup. See #794.
LarsGit223
git-noreply at xxxxx
Thu Nov 29 20:04:30 UTC 2018
Branch: refs/heads/master
Author: LarsGit223 <lars_paulsen at web.de>
Committer: LarsGit223 <lars_paulsen at web.de>
Date: Thu, 29 Nov 2018 20:04:30 UTC
Commit: a5dfaa2c2dfa3a23821b0d8e76c7596ce634bb82
https://github.com/geany/geany-plugins/commit/a5dfaa2c2dfa3a23821b0d8e76c7596ce634bb82
Log Message:
-----------
scope: small code cleanup. See #794.
Modified Paths:
--------------
scope/src/conterm.c
scope/src/memory.c
scope/src/utils.c
Modified: scope/src/conterm.c
8 lines changed, 4 insertions(+), 4 deletions(-)
===================================================================
@@ -184,7 +184,7 @@ static void console_output(int fd, const char *text, gint length)
if (fd != last_fd)
{
setaf[3] = fd_colors[fd];
- vte_terminal_feed(debug_console, setaf, sizeof setaf);
+ vte_terminal_feed(debug_console, setaf, sizeof(setaf));
last_fd = fd;
}
@@ -260,7 +260,7 @@ void context_output(int fd, const char *text, gint length)
}
gtk_text_buffer_place_cursor(context, &end);
- gtk_text_view_scroll_mark_onscreen(debug_context, gtk_text_buffer_get_insert(context));
+ gtk_text_view_scroll_mark_onscreen(debug_context, gtk_text_buffer_get_insert(context));
}
void context_output_nl(int fd, const char *text, gint length)
@@ -327,8 +327,8 @@ static void on_console_copy(G_GNUC_UNUSED const MenuItem *menu_item)
else
#endif
{
- g_signal_emit_by_name(debug_context, "copy-clipboard");
- }
+ g_signal_emit_by_name(debug_context, "copy-clipboard");
+ }
}
static void on_console_select_all(G_GNUC_UNUSED const MenuItem *menu_item)
Modified: scope/src/memory.c
3 lines changed, 1 insertions(+), 2 deletions(-)
===================================================================
@@ -390,8 +390,7 @@ void memory_init(void)
g_signal_connect(tree, "key-press-event", G_CALLBACK(on_memory_key_press),
(gpointer) menu_item_find(memory_menu_items, "memory_read"));
- pointer_size = sizeof(void *) > sizeof &memory_init ? sizeof(void *) :
- sizeof &memory_init;
+ pointer_size = MAX(sizeof(void *), sizeof(&memory_init));
addr_format = g_strdup_printf("%%0%u" G_GINT64_MODIFIER "x ", pointer_size * 2);
memory_configure();
Modified: scope/src/utils.c
4 lines changed, 2 insertions(+), 2 deletions(-)
===================================================================
@@ -99,7 +99,7 @@ gboolean utils_check_path(const gchar *pathname, gboolean file, int mode)
if (stat(path, &buf) == 0)
{
- if (!S_ISDIR(buf.st_mode) == file)
+ if ((!S_ISDIR(buf.st_mode)) == file)
result = access(path, mode) == 0;
else
errno = file ? EISDIR : ENOTDIR;
@@ -324,7 +324,7 @@ gboolean utils_source_filetype(GeanyFiletype *ft)
guint i;
- for (i = 0; i < sizeof ft_id / sizeof ft_id[0]; i++)
+ for (i = 0; i < sizeof(ft_id) / sizeof(ft_id[0]); i++)
if (ft_id[i] == ft->id)
return TRUE;
}
--------------
This E-Mail was brought to you by github_commit_mail.py (Source: https://github.com/geany/infrastructure).
More information about the Plugins-Commits
mailing list