Skip to content

Commit

Permalink
Merge branch 'geany:master' into devhelpplugin
Browse files Browse the repository at this point in the history
  • Loading branch information
liomarhora committed May 28, 2024
2 parents f11706a + 3e38966 commit 39581e3
Show file tree
Hide file tree
Showing 38 changed files with 473 additions and 66 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ concurrency:
env:
CFLAGS: -g -O2 -Werror=pointer-arith -Werror=implicit-function-declaration
CONFIGURE_FLAGS: --disable-silent-rules
CPPCHECKFLAGS: --check-level=exhaustive
CCACHE_DIR: ${{ github.workspace }}/.ccache
CCACHE_COMPRESS: true
CCACHE_MAXSIZE: 1G
Expand Down Expand Up @@ -196,7 +197,7 @@ jobs:
- name: Run distcheck
run: |
cd _build
make -j ${{ env.JOBS }} distcheck DISTCHECK_CONFIGURE_FLAGS="${{ env.CONFIGURE_FLAGS }}";
make -j ${{ env.JOBS }} distcheck DISTCHECK_CONFIGURE_FLAGS="${{ env.CONFIGURE_FLAGS }} --disable-cppcheck";
- name: ccache statistics
if: ${{ env.DEBUG == '1' }}
Expand Down
11 changes: 7 additions & 4 deletions addons/src/ao_tasks.c
Original file line number Diff line number Diff line change
Expand Up @@ -636,18 +636,21 @@ static void free_update_tasks_for_doc_arguments(gpointer data)

static void update_tasks_for_doc(AoTasks *t, GeanyDocument *doc, gboolean clear)
{
AoTasksUpdateTasksForDocArguments *arguments = g_slice_alloc(sizeof *arguments);
arguments->t = t;
arguments->doc = doc;
arguments->clear = clear;
AoTasksUpdateTasksForDocArguments *arguments;

if (!DOC_VALID(doc))
return;

arguments = g_slice_alloc(sizeof *arguments);
arguments->t = t;
arguments->doc = doc;
arguments->clear = clear;

/* Check for task tokens in an idle callback to wait until Geany applied Scintilla highlighting
* styles as we need them to be set before checking for tasks. */
g_idle_add_full(G_PRIORITY_LOW, update_tasks_for_doc_idle_cb, arguments,
free_update_tasks_for_doc_arguments);
/* cppcheck-suppress memleak symbolName=arguments */
}


Expand Down
4 changes: 0 additions & 4 deletions build/cppcheck-geany-plugins.cfg
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
<?xml version="1.0"?>
<def format="2">
<!-- Geany-Plugins macros -->
<define name="PLUGIN" value="&quot;foo&quot;"/>
<!-- GLib macros -->
<define name="G_GSSIZE_FORMAT" value="&quot;li&quot;"/>
<define name="G_GINT64_MODIFIER" value="&quot;l&quot;"/>
<define name="G_DIR_SEPARATOR_S" value="&quot;/&quot;"/>
<define name="G_DEFINE_TYPE(TN, t_n, T_P)" value=""/>
<define name="G_DEFINE_BOXED_TYPE(TypeName,type_name,copy_func,free_func)" value=""/>
</def>
6 changes: 6 additions & 0 deletions build/cppcheck.mk
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,15 @@ if HAVE_CPPCHECK

check-cppcheck: $(srcdir)
$(CPPCHECK) \
--inline-suppr \
-q --template=gcc --error-exitcode=2 \
--library=gtk \
--library=$(top_srcdir)/build/cppcheck-geany-plugins.cfg \
-I$(GEANY_INCLUDEDIR)/geany \
-UGEANY_PRIVATE \
-DGETTEXT_PACKAGE=\"$(GETTEXT_PACKAGE)\" \
$(filter -j%,$(MAKEFLAGS)) \
$(LOCAL_AM_CFLAGS) \
$(AM_CPPCHECKFLAGS) $(CPPCHECKFLAGS) \
$(srcdir)

Expand Down
6 changes: 6 additions & 0 deletions codenav/src/goto_file.c
Original file line number Diff line number Diff line change
Expand Up @@ -163,8 +163,11 @@ directory_check(GtkEntry* entry, GtkEntryCompletion* completion)
if (old_model != NULL)
{ /* Restore the no-sub-directory model */
log_debug("Restoring old model!");

gtk_entry_completion_set_model (completion, old_model);
g_object_unref(old_model);
old_model = NULL;

g_free(curr_dir);
curr_dir = NULL;
}
Expand All @@ -185,7 +188,10 @@ directory_check(GtkEntry* entry, GtkEntryCompletion* completion)

/* Save the completion_mode for future restore. */
if (old_model == NULL)
{
old_model = gtk_entry_completion_get_model(completion);
g_object_ref(old_model);
}

log_debug("New completion list!");

Expand Down
17 changes: 10 additions & 7 deletions geanyctags/README
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,11 @@ About

GeanyCtags adds a simple support for generating and querying ctags files for a Geany
project. It requires that the ctags command is installed in a system path. On
unix systems, distributions usually provide the ctags package; on Windows, the
ctags binary can be found in the zip Windows distribution from the ctags home
page (http://ctags.sourceforge.net).
unix systems, distributions usually provide the ctags (original but orphaned
and unmaintained) or universal-ctags (forked and maintained) packages. On Windows,
the universal-ctags binaries can be downloaded from::

https://github.com/universal-ctags/ctags-win32/releases

Even though Geany supports symbol definition searching by itself within the open files
(and with a plugin support within the whole project), tag regeneration can become
Expand Down Expand Up @@ -97,7 +99,7 @@ Downloads

GeanyCtags is part of the combined Geany Plugins release.
For more information and downloads, please visit
http://plugins.geany.org/geany-plugins/
https://plugins.geany.org/geany-plugins/

Development Code
================
Expand All @@ -109,9 +111,10 @@ Get the code from::
Ideas, questions, patches and bug reports
=========================================

Please direct all questions, bug reports and patches to the plugin author using the
email address listed below or to the Geany mailing list to get some help from other
Geany users.
Please direct all questions, bug reports and patches to the combined geany-plugins
project at https://github.com/geany/geany-plugins and open the corresponding
bug report or pull request there. To notify the author of this plugin about
your post, mention him using his github user name (@techee).

2010-2014 by Jiří Techet
techet(at)gmail(dot)com
2 changes: 2 additions & 0 deletions geanyctags/src/geanyctags.c
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,8 @@ static void spawn_cmd(const gchar *cmd, const gchar *dir)
msgwin_msg_add(COLOR_BLACK, -1, NULL, "%s", out);
}

/* cppcheck-suppress mismatchAllocDealloc symbolName=argv
* argv is built manually, but is a valid GStrv */
g_strfreev(argv);
g_free(working_dir);
g_free(out);
Expand Down
1 change: 1 addition & 0 deletions geanygendoc/src/ggd-options.c
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,7 @@ ggd_opt_group_add_entry (GgdOptGroup *group,

g_array_append_val (group->prefs, entry);

/* cppcheck-suppress memleak symbolName=entry.key */
return &g_array_index (group->prefs, GgdOptEntry, group->prefs->len -1);
}

Expand Down
3 changes: 0 additions & 3 deletions geanyprj/src/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,4 @@ unittests_CFLAGS = $(GEANY_CFLAGS) -DUNITTESTS
unittests_LDADD = @GEANY_LIBS@ $(INTLLIBS) @CHECK_LIBS@
endif

AM_CPPCHECKFLAGS = --suppress='constStatement:*'
AM_CPPCHECKFLAGS += --suppress='memleak:utils.c:72'

include $(top_srcdir)/build/cppcheck.mk
3 changes: 3 additions & 0 deletions geanyprj/src/utils.c
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,10 @@ gchar *normpath(const gchar *filename)
return g_strdup(".");
v = g_strsplit_set(filename, "/\\", -1);
if (!g_strv_length(v))
{
g_strfreev(v);
return g_strdup(".");
}

out = g_malloc0(sizeof(gchar *) * (g_strv_length(v) + 2));
pout = out;
Expand Down
5 changes: 5 additions & 0 deletions geniuspaste/src/geniuspaste.c
Original file line number Diff line number Diff line change
Expand Up @@ -381,6 +381,8 @@ static gchar *pastebin_get_language(const Pastebin *pastebin,
gchar *lang = g_key_file_get_string(pastebin->config, PASTEBIN_GROUP_LANGUAGES,
geany_ft_name, NULL);

/* cppcheck-suppress memleak symbolName=lang
* obvious cppcheck bug */
return lang ? lang : pastebin_get_default(pastebin, "language", "");
}

Expand Down Expand Up @@ -750,6 +752,9 @@ static void show_msgbox(GtkMessageType type, GtkButtonsType buttons,
/* run the dialog */
gtk_dialog_run(GTK_DIALOG(dlg));
gtk_widget_destroy(dlg);

g_free(markup);
/* cppcheck-suppress memleak symbolName=dlg */
}

static void debug_log_message_body(SoupMessage *msg,
Expand Down
1 change: 1 addition & 0 deletions git-changebar/src/gcb-plugin.c
Original file line number Diff line number Diff line change
Expand Up @@ -566,6 +566,7 @@ get_cached_blob_contents_async (const gchar *path,
}

g_async_queue_push (G_queue, job);
/* cppcheck-suppress memleak symbolName=job */
}
}

Expand Down
4 changes: 2 additions & 2 deletions markdown/src/conf.c
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ markdown_config_get_string_key(MarkdownConfig *conf, const gchar *group,
GError *error = NULL;

out_str = g_key_file_get_string(conf->priv->kf, group, key, &error);
if (error) {
if (!out_str) {
g_debug("Config read failed: %s", error->message);
g_error_free(error); error = NULL;
out_str = g_strdup(default_value);
Expand Down Expand Up @@ -451,7 +451,7 @@ markdown_config_save(MarkdownConfig *conf)

/*g_debug("Saving: %s\n%s", conf->priv->filename, contents);*/

if (error) {
if (!contents) {
g_warning("Error getting config data as string: %s", error->message);
g_error_free(error); error = NULL;
return success;
Expand Down
9 changes: 5 additions & 4 deletions projectorganizer/README
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ Downloads

Project Organizer is part of the combined Geany Plugins release.
For more information and downloads, please visit
http://plugins.geany.org/geany-plugins/
https://plugins.geany.org/geany-plugins/

Development Code
================
Expand All @@ -228,9 +228,10 @@ Get the code from::
Ideas, questions, patches and bug reports
=========================================

Please direct all questions, bug reports and patches to the plugin author using the
email address listed below or to the Geany mailing list to get some help from other
Geany users.
Please direct all questions, bug reports and patches to the combined geany-plugins
project at https://github.com/geany/geany-plugins and open the corresponding
bug report or pull request there. To notify the author of this plugin about
your post, mention him using his github user name (@techee).

2010-2014 by Jiří Techet
techet(at)gmail(dot)com
2 changes: 1 addition & 1 deletion projectorganizer/src/prjorg-main.c
Original file line number Diff line number Diff line change
Expand Up @@ -223,5 +223,5 @@ void plugin_cleanup(void)

void plugin_help (void)
{
utils_open_browser("http://plugins.geany.org/projectorganizer.html");
utils_open_browser("https://plugins.geany.org/projectorganizer.html");
}
2 changes: 0 additions & 2 deletions scope/src/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,6 @@ scope_la_CFLAGS = $(AM_CFLAGS) $(VTE_CFLAGS) \
-Wno-shadow \
-I$(top_srcdir)/utils/src

AM_CPPCHECKFLAGS = -DGETTEXT_PACKAGE="geany-plugins"

include $(top_srcdir)/build/cppcheck.mk

if UNITTESTS
Expand Down
4 changes: 4 additions & 0 deletions scope/src/debug.c
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,8 @@ static void create_send_source(void)
g_source_set_callback(send_source, (GSourceFunc) send_commands_cb, NULL,
send_source_destroy_cb);
send_source_id = g_source_attach(send_source, NULL);
/* cppcheck-suppress memleak symbolName=send_source
* the source is attached and managed through its ID */
}

#define HAS_SPAWN_LEAVE_STDIN_OPEN 0
Expand Down Expand Up @@ -347,6 +349,8 @@ static void gdb_finalize(void)
if (send_channel)
{
g_io_channel_shutdown(send_channel, FALSE, NULL);
/* cppcheck-suppress doubleFree symbolName=send_channel
* erroneously thinks g_io_channel_shutdown() frees the channel */
g_io_channel_unref(send_channel);
send_channel = NULL;

Expand Down
3 changes: 0 additions & 3 deletions treebrowser/src/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,4 @@ treebrowser_la_CFLAGS = $(AM_CFLAGS) $(GIO_CFLAGS) \
treebrowser_la_LIBADD = $(COMMONLIBS) $(GIO_LIBS) \
$(top_builddir)/utils/src/libgeanypluginutils.la

AM_CPPCHECKFLAGS = --suppress='deallocDealloc:$(srcdir)/treebrowser.c'
AM_CPPCHECKFLAGS += --suppress='doubleFree:$(srcdir)/treebrowser.c'

include $(top_srcdir)/build/cppcheck.mk
2 changes: 2 additions & 0 deletions treebrowser/src/treebrowser.c
Original file line number Diff line number Diff line change
Expand Up @@ -1121,6 +1121,7 @@ on_menu_create_new_object(GtkMenuItem *menuitem, const gchar *type)
}
g_free(uri_new);
}
/* cppcheck-suppress doubleFree symbolName=uri */
g_free(uri);
}

Expand Down Expand Up @@ -1192,6 +1193,7 @@ on_menu_refresh(GtkMenuItem *menuitem, gpointer *user_data)
}
}
treebrowser_browse(uri, target_iter);
/* cppcheck-suppress doubleFree symbolName=uri */
g_free(uri);
}
else
Expand Down
21 changes: 16 additions & 5 deletions vimode/README
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ This is an incomplete list of known limitations of the plugin:
* named registers and related commands are not implemented
* Ctrl+X mode is not implemented
* marks are not implemented
* fold commands are not implemented
* many fold commands are not implemented
* most commands starting with "'", "z", and "g" are not implemented
* most ex mode commands are not implemented (excluding basic stuff like search,
replace, saving, etc.)
Expand All @@ -106,7 +106,7 @@ This is an incomplete list of known limitations of the plugin:
* only the 'g' flag is supported in the substitute command
* in search and substitute the regular expressions are based on Scintilla regular
expressions which differ from Vim. Check the Scintilla documentation at
http://www.scintilla.org/ScintillaDoc.html#Searching for more details.
https://www.scintilla.org/ScintillaDoc.html#Searching for more details.
In addition, \c is also supported to allow case-insensitive search.

FAQ
Expand Down Expand Up @@ -182,8 +182,10 @@ Jiří Techet, <techet(at)gmail(dot)com>.

Bug Reports
-----------
To report bugs, please use the Geany-Plugins GitHub page at
https://github.com/geany/geany-plugins/issues
Please direct all questions, bug reports and patches to the combined geany-plugins
project at https://github.com/geany/geany-plugins and open the corresponding
bug report or pull request there. To notify the author of this plugin about
your post, mention him using his github user name (@techee).

License
=======
Expand All @@ -198,7 +200,7 @@ Downloads
=========

Vimode is part of the combined Geany Plugins release. For more information and
downloads, please visit http://plugins.geany.org/geany-plugins/
downloads, please visit https://plugins.geany.org/geany-plugins/

Source Code
===========
Expand Down Expand Up @@ -499,7 +501,16 @@ a new command, please do not forget to update the table below.::
cursor on first non-blank
z. z. redraw, cursor line to center of window,
cursor on first non-blank
zA zA open a closed fold or close an open fold
recursively
zC zC close folds recursively
zM zM set 'foldlevel' to zero
zO zO open folds recursively
zR zR set 'foldlevel' to the deepest fold
za za open a closed fold, close an open fold
zb zb redraw, cursor line at bottom of window
zc zc close a fold
zo zo open fold
zt zt redraw, cursor line at top of window
zz zz redraw, cursor line at center of window

Expand Down
6 changes: 5 additions & 1 deletion vimode/src/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,11 @@ vi_srcs = \
cmds/edit.h \
cmds/edit.c \
cmds/excmds.h \
cmds/excmds.c
cmds/excmds.c \
cmds/undo.h \
cmds/undo.c \
cmds/fold.h \
cmds/fold.c

vimode_la_SOURCES = \
backends/backend-geany.c \
Expand Down
2 changes: 1 addition & 1 deletion vimode/src/backends/backend-geany.c
Original file line number Diff line number Diff line change
Expand Up @@ -337,5 +337,5 @@ void plugin_cleanup(void)

void plugin_help(void)
{
utils_open_browser("http://plugins.geany.org/vimode.html");
utils_open_browser("https://plugins.geany.org/vimode.html");
}
Loading

0 comments on commit 39581e3

Please sign in to comment.