lists.geany.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
List overview
Plugins-Commits
June 2012
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
plugins-commits@lists.geany.org
1 participants
93 discussions
Start a n
N
ew thread
[geany/geany-plugins] 27fcd5: Autotools: Use check_PROGRAMS for tests
by Quentin Glidic
16 Jun '12
16 Jun '12
Branch: refs/heads/master Author: Quentin Glidic <sardemff7+git(a)sardemff7.net> Committer: Chow Loong Jin <hyperair(a)debian.org> Date: Sat, 16 Jun 2012 16:23:06 Commit: 27fcd5630e268b368b225c41123530525b9705ba
https://github.com/geany/geany-plugins/commit/27fcd5630e268b368b225c4112353…
Log Message: ----------- Autotools: Use check_PROGRAMS for tests Modified Paths: -------------- geanyprj/tests/Makefile.am geanyvc/tests/Makefile.am Modified: geanyprj/tests/Makefile.am 2 files changed, 1 insertions(+), 1 deletions(-) =================================================================== @@ -2,7 +2,7 @@ if UNITTESTS include $(top_srcdir)/build/vars.build.mk INCLUDES = $(GEANY_CFLAGS) -I$(srcdir)/../src -DUNITTESTS TESTS=unittests -noinst_PROGRAMS=unittests +check_PROGRAMS=unittests unittests_SOURCES = unittests.c ../src/utils.c unittests_LDADD = @GEANY_LIBS@ $(INTLLIBS) @CHECK_LIBS@ endif Modified: geanyvc/tests/Makefile.am 2 files changed, 1 insertions(+), 1 deletions(-) =================================================================== @@ -3,7 +3,7 @@ if ENABLE_GEANYVC include $(top_srcdir)/build/vars.build.mk INCLUDES = $(GEANY_CFLAGS) -DUNITTESTS TESTS=unittests -noinst_PROGRAMS=unittests +check_PROGRAMS=unittests unittests_SOURCES = unittests.c ../src/utils.c unittests_LDADD = @GEANY_LIBS@ $(INTLLIBS) @CHECK_LIBS@ endif @@ Diff output truncated at 100000 characters. @@ -------------- This E-Mail was brought to you by github_commit_mail.py (Source: TBD).
1
0
0
0
[geany/geany-plugins] 94cb85: Autotools: Avoid most EXTRA_DIST
by Quentin Glidic
16 Jun '12
16 Jun '12
Branch: refs/heads/master Author: Quentin Glidic <sardemff7+git(a)sardemff7.net> Committer: Chow Loong Jin <hyperair(a)debian.org> Date: Sat, 16 Jun 2012 16:23:06 Commit: 94cb8541d4a184205a58619aa82e0196a716d4d3
https://github.com/geany/geany-plugins/commit/94cb8541d4a184205a58619aa82e0…
Log Message: ----------- Autotools: Avoid most EXTRA_DIST Using dist_ prefix for the plugin doc and data files allows us to remove some unneeded EXTRA_DIST Modified Paths: -------------- build/vars.auxfiles.mk build/vars.docs.mk debugger/Makefile.am debugger/img/Makefile.am devhelp/data/Makefile.am geanygendoc/Makefile.am geanygendoc/data/filetypes/Makefile.am geanygendoc/docs/Makefile.am geanylatex/doc/Makefile.am geanylua/Makefile.am geanylua/docs/Makefile.am geanylua/examples/dialogs/Makefile.am geanylua/examples/edit/Makefile.am geanylua/examples/info/Makefile.am geanylua/examples/scripting/Makefile.am geanylua/examples/work/Makefile.am gproject/icons/Makefile.am multiterm/Makefile.am spellcheck/Makefile.am treebrowser/Makefile.am webhelper/Makefile.am Modified: build/vars.auxfiles.mk 9 files changed, 8 insertions(+), 1 deletions(-) =================================================================== @@ -1,6 +1,13 @@ include $(top_srcdir)/build/vars.docs.mk -plugindoc_DATA = $(AUXFILES) +dist_plugindoc_DATA = \ + README \ + ChangeLog \ + NEWS \ + COPYING \ + AUTHORS \ + $(AUXFILES) + EXTRA_DIST = \ wscript_build \ wscript_configure Modified: build/vars.docs.mk 7 files changed, 0 insertions(+), 7 deletions(-) =================================================================== @@ -3,10 +3,3 @@ htmldocdir = $(plugindocdir) plugindatadir = $(pkgdatadir)/$(plugin) pluginlibdir = $(pkglibdir)/$(plugin) examplesdir = $(plugindatadir) -AUXFILES = \ - README \ - ChangeLog \ - NEWS \ - COPYING \ - AUTHORS - Modified: debugger/Makefile.am 1 files changed, 0 insertions(+), 1 deletions(-) =================================================================== @@ -2,7 +2,6 @@ if ENABLE_DEBUGGER include $(top_srcdir)/build/vars.auxfiles.mk else include $(top_srcdir)/build/vars.docs.mk -EXTRA_DIST = endif SUBDIRS = src img Modified: debugger/img/Makefile.am 11 files changed, 3 insertions(+), 8 deletions(-) =================================================================== @@ -1,7 +1,9 @@ include $(top_srcdir)/build/vars.docs.mk plugin = debugger -FILES = \ + +if ENABLE_DEBUGGER +dist_plugindata_DATA = \ continue.png \ restart.gif \ run.gif \ @@ -11,11 +13,4 @@ FILES = \ step_over.gif \ stop.gif \ tabs.gif - -EXTRA_DIST = $(FILES) - -if ENABLE_DEBUGGER -plugindata_DATA = $(FILES) -else -EXTRA_DATA = $(FILES) endif Modified: devhelp/data/Makefile.am 10 files changed, 3 insertions(+), 7 deletions(-) =================================================================== @@ -1,17 +1,13 @@ +if ENABLE_DEVHELP include $(top_srcdir)/build/vars.docs.mk plugin = devhelp -FILES = \ + +dist_plugindata_DATA = \ devhelp-plugin.svg \ devhelp-plugin-48.png \ geany-devhelp-plugin.png \ home.html \ devhelp.conf -EXTRA_DIST = $(FILES) - -if ENABLE_DEVHELP -plugindata_DATA = $(FILES) -else -EXTRA_DATA = $(FILES) endif Modified: geanygendoc/Makefile.am 1 files changed, 0 insertions(+), 1 deletions(-) =================================================================== @@ -2,7 +2,6 @@ if ENABLE_GEANYGENDOC include $(top_srcdir)/build/vars.auxfiles.mk else include $(top_srcdir)/build/vars.docs.mk -EXTRA_DIST = $(AUXFILES) endif SUBDIRS = src docs data Modified: geanygendoc/data/filetypes/Makefile.am 16 files changed, 6 insertions(+), 10 deletions(-) =================================================================== @@ -1,15 +1,11 @@ if ENABLE_GEANYGENDOC +include $(top_srcdir)/build/vars.docs.mk + plugin = geanygendoc -# FIXME: should probably done by an included .mk such as vars.data.mk -plugindatadir = $(pkgdatadir)/$(plugin) -endif +filetypesdir = $(plugindatadir)/filetypes -FILETYPES = c.conf \ - vala.conf +dist_filetypes_DATA = \ + c.conf \ + vala.conf -if ENABLE_GEANYGENDOC -filetypesdir = $(plugindatadir)/filetypes -filetypes_DATA = $(FILETYPES) endif - -EXTRA_DIST = $(FILETYPES) Modified: geanygendoc/docs/Makefile.am 17 files changed, 9 insertions(+), 8 deletions(-) =================================================================== @@ -2,19 +2,20 @@ if ENABLE_GEANYGENDOC include $(top_srcdir)/build/vars.docs.mk plugin = geanygendoc pluginhtmldocdir = $(plugindocdir)/html -endif ENABLE_GEANYGENDOC -EXTRA_DIST = manual.rst \ - manual.css \ - html4css1.css \ - manual.html +EXTRA_DIST = \ + manual.css \ + html4css1.css -if ENABLE_GEANYGENDOC -plugindoc_DATA = manual.rst -pluginhtmldoc_DATA = manual.html +dist_plugindoc_DATA = \ + manual.rst + +dist_pluginhtmldoc_DATA = \ + manual.html if BUILD_RST manual.html: manual.rst manual.css $(AM_V_GEN) $(RST2HTML) -d --strict --stylesheet-path manual.css $< $@ endif BUILD_RST + endif ENABLE_GEANYGENDOC Modified: geanylatex/doc/Makefile.am 7 files changed, 2 insertions(+), 5 deletions(-) =================================================================== @@ -1,6 +1,7 @@ +if ENABLE_GEANYLATEX include $(top_srcdir)/build/vars.docs.mk -docfiles = \ +dist_plugindoc_DATA = \ geanylatex2.html \ geanylatex3.html \ geanylatex4.html \ @@ -17,8 +18,4 @@ docfiles = \ img/plugin_manager.png \ img/toolbar.png -EXTRA_DIST = $(docfiles) - -if ENABLE_GEANYLATEX -plugindoc_DATA = $(docfiles) endif Modified: geanylua/Makefile.am 3 files changed, 1 insertions(+), 2 deletions(-) =================================================================== @@ -4,9 +4,8 @@ include $(top_srcdir)/build/vars.auxfiles.mk plugin = geanylua else include $(top_srcdir)/build/vars.docs.mk -EXTRA_DIST = $(AUXFILES) endif -EXTRA_DIST += util +EXTRA_DIST = util include $(top_srcdir)/build/vars.build.mk Modified: geanylua/docs/Makefile.am 10 files changed, 1 insertions(+), 9 deletions(-) =================================================================== @@ -1,12 +1,9 @@ -# don't include if geanylua's disabled, otherwise a whole bunch of empty -# directories will be created if ENABLE_GEANYLUA include $(top_srcdir)/build/vars.docs.mk -endif plugin = geanylua -DOCFILES = \ +dist_htmldoc_DATA = \ geanylua-index.html \ geanylua-input.html \ geanylua-intro.html \ @@ -15,9 +12,4 @@ DOCFILES = \ geanylua-ref.html \ luarefv51.html -if ENABLE_GEANYLUA -htmldoc_DATA = $(DOCFILES) endif - -# make sure that these files are distributed as well -EXTRA_DIST = $(DOCFILES) Modified: geanylua/examples/dialogs/Makefile.am 10 files changed, 2 insertions(+), 8 deletions(-) =================================================================== @@ -1,17 +1,11 @@ -# avoid creating empty directories if disabled if ENABLE_GEANYLUA include $(top_srcdir)/build/vars.docs.mk + plugin = geanylua dialogsdir = $(examplesdir)/dialogs -endif -EXAMPLES = \ +dist_dialogs_DATA = \ basic-dialogs.lua \ complex-dialog.lua -if ENABLE_GEANYLUA -dialogs_DATA = $(EXAMPLES) endif - -# make sure that these files are distributed as well -EXTRA_DIST = $(EXAMPLES) Modified: geanylua/examples/edit/Makefile.am 10 files changed, 2 insertions(+), 8 deletions(-) =================================================================== @@ -1,11 +1,10 @@ -# avoid creating empty directories if disabled if ENABLE_GEANYLUA include $(top_srcdir)/build/vars.docs.mk + plugin = geanylua editdir = $(examplesdir)/edit -endif -EXAMPLES = \ +dist_edit_DATA = \ calculator.lua \ lua-replace.lua \ proper-case.lua \ @@ -13,9 +12,4 @@ EXAMPLES = \ right-trim.lua \ select-block.lua -if ENABLE_GEANYLUA -edit_DATA = $(EXAMPLES) endif - -# make sure that these files are distributed as well -EXTRA_DIST = $(EXAMPLES) Modified: geanylua/examples/info/Makefile.am 10 files changed, 2 insertions(+), 8 deletions(-) =================================================================== @@ -1,20 +1,14 @@ -# avoid creating empty directories if disabled if ENABLE_GEANYLUA include $(top_srcdir)/build/vars.docs.mk + plugin = geanylua exampleinfodir = $(examplesdir)/info -endif -EXAMPLES = \ +dist_exampleinfo_DATA = \ about.lua \ app-information.lua \ file-information.lua \ list-open-files.lua \ show-filename.lua -if ENABLE_GEANYLUA -exampleinfo_DATA = $(EXAMPLES) endif - -# make sure that these files are distributed as well -EXTRA_DIST = $(EXAMPLES) Modified: geanylua/examples/scripting/Makefile.am 10 files changed, 2 insertions(+), 8 deletions(-) =================================================================== @@ -1,19 +1,13 @@ -# avoid creating empty directories if disabled if ENABLE_GEANYLUA include $(top_srcdir)/build/vars.docs.mk + plugin = geanylua scriptingdir = $(examplesdir)/scripting -endif -EXAMPLES = \ +dist_scripting_DATA = \ help.lua \ open-script.lua \ rebuild-menu.lua \ show-examples.lua -if ENABLE_GEANYLUA -scripting_DATA = $(EXAMPLES) endif - -# make sure that these files are distributed as well -EXTRA_DIST = $(EXAMPLES) Modified: geanylua/examples/work/Makefile.am 10 files changed, 2 insertions(+), 8 deletions(-) =================================================================== @@ -1,18 +1,12 @@ -# avoid creating empty directories if disabled if ENABLE_GEANYLUA include $(top_srcdir)/build/vars.docs.mk + plugin = geanylua workdir = $(examplesdir)/work -endif -EXAMPLES = \ +dist_work_DATA = \ 01.edit-test-script.lua \ 02.run-test-script.lua \ 03.install-test-script.lua -if ENABLE_GEANYLUA -work_DATA = $(EXAMPLES) endif - -# make sure that these files are distributed as well -EXTRA_DIST = $(EXAMPLES) Modified: gproject/icons/Makefile.am 9 files changed, 2 insertions(+), 7 deletions(-) =================================================================== @@ -1,6 +1,7 @@ +if ENABLE_GPROJECT icondir = $(datadir)/icons/hicolor/16x16/apps -ICONS = \ +dist_icon_DATA = \ gproject-file.png \ gproject-header.png \ gproject-source.png \ @@ -9,8 +10,6 @@ ICONS = \ gproject-follow.png \ gproject-refresh.png -EXTRA_DIST = $(ICONS) - gtk_update_icon_cache = gtk-update-icon-cache -f -t $(datadir)/icons/hicolor install-data-hook: update-icon-cache uninstall-hook: update-icon-cache @@ -23,8 +22,4 @@ update-icon-cache: echo "*** $(gtk_update_icon_cache)"; \ fi -if ENABLE_GPROJECT -icon_DATA = $(ICONS) -else -EXTRA_DATA = $(ICONS) endif Modified: multiterm/Makefile.am 3 files changed, 1 insertions(+), 2 deletions(-) =================================================================== @@ -2,10 +2,9 @@ if ENABLE_MULTITERM include $(top_srcdir)/build/vars.auxfiles.mk else include $(top_srcdir)/build/vars.docs.mk -EXTRA_DIST = $(AUXFILES) endif -AUXFILES += TODO +AUXFILES = TODO SUBDIRS = src plugin = multiterm Modified: spellcheck/Makefile.am 1 files changed, 0 insertions(+), 1 deletions(-) =================================================================== @@ -3,7 +3,6 @@ if ENABLE_SPELLCHECK include $(top_srcdir)/build/vars.auxfiles.mk else include $(top_srcdir)/build/vars.docs.mk -EXTRA_DIST = $(AUXFILES) endif SUBDIRS = src Modified: treebrowser/Makefile.am 1 files changed, 0 insertions(+), 1 deletions(-) =================================================================== @@ -2,7 +2,6 @@ if ENABLE_TREEBROWSER include $(top_srcdir)/build/vars.auxfiles.mk else include $(top_srcdir)/build/vars.docs.mk -EXTRA_DIST = $(AUXFILES) endif SUBDIRS = src Modified: webhelper/Makefile.am 3 files changed, 1 insertions(+), 2 deletions(-) =================================================================== @@ -2,10 +2,9 @@ if ENABLE_WEBHELPER include $(top_srcdir)/build/vars.auxfiles.mk else include $(top_srcdir)/build/vars.docs.mk -EXTRA_DIST = $(AUXFILES) endif -AUXFILES += TODO +AUXFILES = TODO SUBDIRS = src plugin = webhelper @@ Diff output truncated at 100000 characters. @@ -------------- This E-Mail was brought to you by github_commit_mail.py (Source: TBD).
1
0
0
0
[geany/geany-plugins] 9c70e2: debugger: Pass XPMs as source files
by Quentin Glidic
16 Jun '12
16 Jun '12
Branch: refs/heads/master Author: Quentin Glidic <sardemff7+git(a)sardemff7.net> Committer: Chow Loong Jin <hyperair(a)debian.org> Date: Sat, 16 Jun 2012 16:23:06 Commit: 9c70e238ec5bc5b22057596ae43946363c61c37e
https://github.com/geany/geany-plugins/commit/9c70e238ec5bc5b22057596ae4394…
Log Message: ----------- debugger: Pass XPMs as source files This avoids EXTRA_DIST usage Modified Paths: -------------- debugger/src/Makefile.am debugger/src/xpm/Makefile.am Modified: debugger/src/Makefile.am 11 files changed, 8 insertions(+), 3 deletions(-) =================================================================== @@ -1,8 +1,6 @@ include $(top_srcdir)/build/vars.build.mk include $(top_srcdir)/build/vars.docs.mk -SUBDIRS = xpm - if ENABLE_DEBUGGER geanyplugins_LTLIBRARIES = debugger.la else @@ -12,6 +10,14 @@ endif plugin = debugger debugger_la_SOURCES = \ + xpm/breakpoint_condition.xpm \ + xpm/breakpoint_disabled.xpm \ + xpm/breakpoint.xpm \ + xpm/frame_current.xpm \ + xpm/frame.xpm \ + xpm/argument.xpm \ + xpm/local.xpm \ + xpm/watch.xpm \ bptree.c \ bptree.h \ breakpoint.c \ @@ -66,7 +72,6 @@ debugger_la_SOURCES = \ cell_renderers/cellrendererframeicon.h \ cell_renderers/cellrenderertoggle.c \ cell_renderers/cellrenderertoggle.h - debugger_la_LIBADD = $(COMMONLIBS) $(VTE_LIBS) -lutil debugger_la_CFLAGS = $(AM_CFLAGS) $(VTE_CFLAGS) -DDBGPLUG_DATA_DIR=\"$(plugindatadir)\" -DPLUGIN_NAME=\"$(plugin)\" Modified: debugger/src/xpm/Makefile.am 10 files changed, 0 insertions(+), 10 deletions(-) =================================================================== @@ -1,10 +0,0 @@ - -EXTRA_DIST = \ - breakpoint_condition.xpm \ - breakpoint_disabled.xpm \ - breakpoint.xpm \ - frame_current.xpm \ - frame.xpm \ - argument.xpm \ - local.xpm \ - watch.xpm @@ Diff output truncated at 100000 characters. @@ -------------- This E-Mail was brought to you by github_commit_mail.py (Source: TBD).
1
0
0
0
[geany/geany-plugins] c7fda3: multiterm: Fix automake Vala header detection
by Quentin Glidic
16 Jun '12
16 Jun '12
Branch: refs/heads/master Author: Quentin Glidic <sardemff7+git(a)sardemff7.net> Committer: Chow Loong Jin <hyperair(a)debian.org> Date: Sat, 16 Jun 2012 16:23:06 Commit: c7fda3953ee4379830fef6aa9c5bf641528d3556
https://github.com/geany/geany-plugins/commit/c7fda3953ee4379830fef6aa9c5bf…
Log Message: ----------- multiterm: Fix automake Vala header detection Modified Paths: -------------- multiterm/src/Makefile.am Modified: multiterm/src/Makefile.am 6 files changed, 2 insertions(+), 4 deletions(-) =================================================================== @@ -9,12 +9,12 @@ else EXTRA_LTLIBRARIES = multiterm.la endif -VALAFLAGS = \ +multiterm_la_VALAFLAGS = \ --vapidir $(top_srcdir)/multiterm/src/vapi \ --pkg gtk+-2.0 \ --pkg geany \ --pkg vte \ - --header=multiterm.h \ + --header multiterm.h \ --use-header multiterm_la_SOURCES = \ @@ -33,5 +33,3 @@ multiterm_la_CFLAGS = \ multiterm_la_LIBADD = \ $(MULTITERM_LIBS) - -EXTRA_DIST = multiterm.h @@ Diff output truncated at 100000 characters. @@ -------------- This E-Mail was brought to you by github_commit_mail.py (Source: TBD).
1
0
0
0
[geany/geany-plugins] 601eca: geanyvc: Remove AM_CONDITIONAL
by Quentin Glidic
16 Jun '12
16 Jun '12
Branch: refs/heads/master Author: Quentin Glidic <sardemff7+git(a)sardemff7.net> Committer: Chow Loong Jin <hyperair(a)debian.org> Date: Sat, 16 Jun 2012 16:23:06 Commit: 601eca1b016331ca9a621620b37f6f8fbde258c6
https://github.com/geany/geany-plugins/commit/601eca1b016331ca9a621620b37f6…
Log Message: ----------- geanyvc: Remove AM_CONDITIONAL Modified Paths: -------------- build/geanyvc.m4 geanyvc/src/Makefile.am Modified: build/geanyvc.m4 4 files changed, 3 insertions(+), 1 deletions(-) =================================================================== @@ -13,12 +13,14 @@ AC_DEFUN([GP_CHECK_GEANYVC], elif [[ x"$enable_gtkspell" = "xyes" ]]; then PKG_CHECK_MODULES(GTKSPELL, [gtkspell-2.0]) fi + if [[ x"$enable_gtkspell" = "xyes" ]]; then + AC_DEFINE(USE_GTKSPELL, 1, [GtkSpell support]) + fi if [[ "$enable_gtkspell" = yes -a "$enable_geanyvc" = no ]]; then AC_MSG_WARN([GtkSpell support for GeanyVC enabled, but GeanyVC itself not enabled.]) fi - AM_CONDITIONAL(USE_GTKSPELL, test $enable_gtkspell = yes) GP_STATUS_FEATURE_ADD([GeanyVC GtkSpell support], [$enable_gtkspell]) AC_CONFIG_FILES([ Modified: geanyvc/src/Makefile.am 14 files changed, 6 insertions(+), 8 deletions(-) =================================================================== @@ -18,14 +18,12 @@ geanyvc_la_SOURCES = \ vc_svn.c \ geanyvc.h -geanyvc_la_CFLAGS = $(AM_CFLAGS) -geanyvc_la_LIBADD = $(COMMONLIBS) - -if USE_GTKSPELL -geanyvc_la_CFLAGS += \ - -DUSE_GTKSPELL=1 \ +geanyvc_la_CFLAGS = \ + $(AM_CFLAGS) \ $(GTKSPELL_CFLAGS) -geanyvc_la_LIBADD += $(GTKSPELL_LIBS) -endif + +geanyvc_la_LIBADD = \ + $(GTKSPELL_LIBS) \ + $(COMMONLIBS) include $(top_srcdir)/build/cppcheck.mk @@ Diff output truncated at 100000 characters. @@ -------------- This E-Mail was brought to you by github_commit_mail.py (Source: TBD).
1
0
0
0
[geany/geany-plugins] 173988: Autotools: Remove EXTRA_LTLIBRARIES
by Quentin Glidic
16 Jun '12
16 Jun '12
Branch: refs/heads/master Author: Quentin Glidic <sardemff7+git(a)sardemff7.net> Committer: Chow Loong Jin <hyperair(a)debian.org> Date: Sat, 16 Jun 2012 16:23:06 Commit: 17398872df18a163af061499075af0479103ce3c
https://github.com/geany/geany-plugins/commit/17398872df18a163af061499075af…
Log Message: ----------- Autotools: Remove EXTRA_LTLIBRARIES Modified Paths: -------------- addons/src/Makefile.am codenav/src/Makefile.am debugger/src/Makefile.am devhelp/src/Makefile.am geanydoc/src/Makefile.am geanyextrasel/src/Makefile.am geanygdb/src/Makefile.am geanygendoc/src/Makefile.am geanyinsertnum/src/Makefile.am geanylatex/src/Makefile.am geanylipsum/src/Makefile.am geanylua/Makefile.am geanymacro/src/Makefile.am geanyminiscript/src/Makefile.am geanynumberedbookmarks/src/Makefile.am geanypg/src/Makefile.am geanyprj/src/Makefile.am geanysendmail/src/Makefile.am geanyvc/src/Makefile.am geniuspaste/src/Makefile.am gproject/src/Makefile.am multiterm/src/Makefile.am pretty-printer/src/Makefile.am shiftcolumn/src/Makefile.am spellcheck/src/Makefile.am tableconvert/src/Makefile.am treebrowser/src/Makefile.am updatechecker/src/Makefile.am webhelper/src/Makefile.am xmlsnippets/src/Makefile.am Modified: addons/src/Makefile.am 2 files changed, 0 insertions(+), 2 deletions(-) =================================================================== @@ -2,8 +2,6 @@ include $(top_srcdir)/build/vars.build.mk if ENABLE_ADDONS geanyplugins_LTLIBRARIES = addons.la -else -EXTRA_LTLIBRARIES = addons.la endif addons_la_SOURCES = \ Modified: codenav/src/Makefile.am 2 files changed, 0 insertions(+), 2 deletions(-) =================================================================== @@ -2,8 +2,6 @@ include $(top_srcdir)/build/vars.build.mk if ENABLE_CODENAV geanyplugins_LTLIBRARIES = codenav.la -else -EXTRA_LTLIBRARIES = codenav.la endif codenav_la_SOURCES = \ Modified: debugger/src/Makefile.am 2 files changed, 0 insertions(+), 2 deletions(-) =================================================================== @@ -3,8 +3,6 @@ include $(top_srcdir)/build/vars.docs.mk if ENABLE_DEBUGGER geanyplugins_LTLIBRARIES = debugger.la -else -EXTRA_LTLIBRARIES = debugger.la endif plugin = debugger Modified: devhelp/src/Makefile.am 2 files changed, 0 insertions(+), 2 deletions(-) =================================================================== @@ -4,8 +4,6 @@ plugin = devhelp if ENABLE_DEVHELP geanyplugins_LTLIBRARIES = devhelp.la -else -EXTRA_LTLIBRARIES = devhelp.la endif devhelp_la_SOURCES = \ Modified: geanydoc/src/Makefile.am 2 files changed, 0 insertions(+), 2 deletions(-) =================================================================== @@ -2,8 +2,6 @@ include $(top_srcdir)/build/vars.build.mk if ENABLE_GEANYDOC geanyplugins_LTLIBRARIES = geanydoc.la -else -EXTRA_LTLIBRARIES = geanydoc.la endif geanydoc_la_SOURCES = \ Modified: geanyextrasel/src/Makefile.am 2 files changed, 0 insertions(+), 2 deletions(-) =================================================================== @@ -2,8 +2,6 @@ include $(top_srcdir)/build/vars.build.mk if ENABLE_GEANYEXTRASEL geanyplugins_LTLIBRARIES = geanyextrasel.la -else -EXTRA_LTLIBRARIES = geanyextrasel.la endif geanyextrasel_la_SOURCES = extrasel.c Modified: geanygdb/src/Makefile.am 3 files changed, 0 insertions(+), 3 deletions(-) =================================================================== @@ -4,9 +4,6 @@ if ENABLE_GEANYGDB geanygdbdir = $(libexecdir)/geany-plugins/geanygdb geanyplugins_LTLIBRARIES = geanygdb.la geanygdb_PROGRAMS = ttyhelper -else -EXTRA_LTLIBRARIES = geanygdb.la -EXTRA_PROGRAMS = ttyhelper endif geanygdb_la_SOURCES = \ Modified: geanygendoc/src/Makefile.am 2 files changed, 0 insertions(+), 2 deletions(-) =================================================================== @@ -3,8 +3,6 @@ plugin = geanygendoc if ENABLE_GEANYGENDOC geanyplugins_LTLIBRARIES = geanygendoc.la -else -EXTRA_LTLIBRARIES = geanygendoc.la endif geanygendoc_la_SOURCES = \ Modified: geanyinsertnum/src/Makefile.am 2 files changed, 0 insertions(+), 2 deletions(-) =================================================================== @@ -2,8 +2,6 @@ include $(top_srcdir)/build/vars.build.mk if ENABLE_GEANYINSERTNUM geanyplugins_LTLIBRARIES = geanyinsertnum.la -else -EXTRA_LTLIBRARIES = geanyinsertnum.la endif geanyinsertnum_la_SOURCES = insertnum.c Modified: geanylatex/src/Makefile.am 2 files changed, 0 insertions(+), 2 deletions(-) =================================================================== @@ -2,8 +2,6 @@ include $(top_srcdir)/build/vars.build.mk if ENABLE_GEANYLATEX geanyplugins_LTLIBRARIES = geanylatex.la -else -EXTRA_LTLIBRARIES = geanylatex.la endif geanylatex_la_SOURCES = \ Modified: geanylipsum/src/Makefile.am 2 files changed, 0 insertions(+), 2 deletions(-) =================================================================== @@ -2,8 +2,6 @@ include $(top_srcdir)/build/vars.build.mk if ENABLE_GEANYLIPSUM geanyplugins_LTLIBRARIES = geanylipsum.la -else -EXTRA_LTLIBRARIES = geanylipsum.la endif geanylipsum_la_SOURCES = geanylipsum.c Modified: geanylua/Makefile.am 2 files changed, 0 insertions(+), 2 deletions(-) =================================================================== @@ -14,8 +14,6 @@ if ENABLE_GEANYLUA geanyplugins_LTLIBRARIES = geanylua.la geanyluadir = $(pkglibdir)/geanylua geanylua_LTLIBRARIES = libgeanylua.la -else -EXTRA_LTLIBRARIES = geanylua.la libgeanylua.la endif geanylua_la_SOURCES = geanylua.c Modified: geanymacro/src/Makefile.am 2 files changed, 0 insertions(+), 2 deletions(-) =================================================================== @@ -2,8 +2,6 @@ include $(top_srcdir)/build/vars.build.mk if ENABLE_GEANYMACRO geanyplugins_LTLIBRARIES = geanymacro.la -else -EXTRA_LTLIBRARIES = geanymacro.la endif geanymacro_la_SOURCES = geanymacro.c Modified: geanyminiscript/src/Makefile.am 2 files changed, 0 insertions(+), 2 deletions(-) =================================================================== @@ -2,8 +2,6 @@ include $(top_srcdir)/build/vars.build.mk if ENABLE_GEANYMINISCRIPT geanyplugins_LTLIBRARIES = geanyminiscript.la -else -EXTRA_LTLIBRARIES = geanyminiscript.la endif geanyminiscript_la_SOURCES = gms.c gms.h gms_gui.c gms_gui.h gms_debug.h Modified: geanynumberedbookmarks/src/Makefile.am 2 files changed, 0 insertions(+), 2 deletions(-) =================================================================== @@ -2,8 +2,6 @@ include $(top_srcdir)/build/vars.build.mk if ENABLE_GEANYNUMBEREDBOOKMARKS geanyplugins_LTLIBRARIES = geanynumberedbookmarks.la -else -EXTRA_LTLIBRARIES = geanynumberedbookmarks.la endif geanynumberedbookmarks_la_SOURCES = geanynumberedbookmarks.c Modified: geanypg/src/Makefile.am 2 files changed, 0 insertions(+), 2 deletions(-) =================================================================== @@ -2,8 +2,6 @@ include $(top_srcdir)/build/vars.build.mk if ENABLE_GEANYPG geanyplugins_LTLIBRARIES = geanypg.la -else -EXTRA_LTLIBRARIES = geanypg.la endif geanypg_la_SOURCES = \ Modified: geanyprj/src/Makefile.am 3 files changed, 1 insertions(+), 2 deletions(-) =================================================================== @@ -2,9 +2,8 @@ include $(top_srcdir)/build/vars.build.mk if ENABLE_GEANYPRJ geanyplugins_LTLIBRARIES = geanyprj.la -else -EXTRA_LTLIBRARIES = geanyprj.la endif + geanyprj_la_SOURCES = geanyprj.c \ geanyprj.h \ menu.c \ Modified: geanysendmail/src/Makefile.am 2 files changed, 0 insertions(+), 2 deletions(-) =================================================================== @@ -2,8 +2,6 @@ include $(top_srcdir)/build/vars.build.mk if ENABLE_GEANYSENDMAIL geanyplugins_LTLIBRARIES = geanysendmail.la -else -EXTRA_LTLIBRARIES = geanysendmail.la endif geanysendmail_la_SOURCES = geanysendmail.c icon.h Modified: geanyvc/src/Makefile.am 2 files changed, 0 insertions(+), 2 deletions(-) =================================================================== @@ -2,8 +2,6 @@ include $(top_srcdir)/build/vars.build.mk if ENABLE_GEANYVC geanyplugins_LTLIBRARIES = geanyvc.la -else -EXTRA_LTLIBRARIES = geanyvc.la endif geanyvc_la_SOURCES = \ Modified: geniuspaste/src/Makefile.am 2 files changed, 0 insertions(+), 2 deletions(-) =================================================================== @@ -3,8 +3,6 @@ plugin = geniuspaste if ENABLE_GENIUSPASTE geanyplugins_LTLIBRARIES = geniuspaste.la -else -EXTRA_LTLIBRARIES = geniuspaste.la endif geniuspaste_la_SOURCES = geniuspaste.c Modified: gproject/src/Makefile.am 3 files changed, 1 insertions(+), 2 deletions(-) =================================================================== @@ -2,9 +2,8 @@ include $(top_srcdir)/build/vars.build.mk if ENABLE_GPROJECT geanyplugins_LTLIBRARIES = gproject.la -else -EXTRA_LTLIBRARIES = gproject.la endif + gproject_la_SOURCES = \ gproject-main.c \ gproject-project.h \ Modified: multiterm/src/Makefile.am 2 files changed, 0 insertions(+), 2 deletions(-) =================================================================== @@ -5,8 +5,6 @@ plugin = multiterm if ENABLE_MULTITERM geanyplugins_LTLIBRARIES = multiterm.la -else -EXTRA_LTLIBRARIES = multiterm.la endif multiterm_la_VALAFLAGS = \ Modified: pretty-printer/src/Makefile.am 2 files changed, 0 insertions(+), 2 deletions(-) =================================================================== @@ -2,8 +2,6 @@ include $(top_srcdir)/build/vars.build.mk if ENABLE_PRETTY_PRINTER geanyplugins_LTLIBRARIES = pretty-printer.la -else -EXTRA_LTLIBRARIES = pretty-printer.la endif pretty_printer_la_SOURCES = \ Modified: shiftcolumn/src/Makefile.am 2 files changed, 0 insertions(+), 2 deletions(-) =================================================================== @@ -2,8 +2,6 @@ include $(top_srcdir)/build/vars.build.mk if ENABLE_SHIFTCOLUMN geanyplugins_LTLIBRARIES = shiftcolumn.la -else -EXTRA_LTLIBRARIES = shiftcolumn.la endif shiftcolumn_la_SOURCES = shiftcolumn.c Modified: spellcheck/src/Makefile.am 2 files changed, 0 insertions(+), 2 deletions(-) =================================================================== @@ -2,8 +2,6 @@ include $(top_srcdir)/build/vars.build.mk if ENABLE_SPELLCHECK geanyplugins_LTLIBRARIES = spellcheck.la -else -EXTRA_LTLIBRARIES = spellcheck.la endif spellcheck_la_SOURCES = \ Modified: tableconvert/src/Makefile.am 2 files changed, 0 insertions(+), 2 deletions(-) =================================================================== @@ -2,8 +2,6 @@ include $(top_srcdir)/build/vars.build.mk if ENABLE_TABLECONVERT geanyplugins_LTLIBRARIES = tableconvert.la -else -EXTRA_LTLIBRARIES = tableconvert.la endif tableconvert_la_SOURCES = tableconvert.c Modified: treebrowser/src/Makefile.am 2 files changed, 0 insertions(+), 2 deletions(-) =================================================================== @@ -2,8 +2,6 @@ include $(top_srcdir)/build/vars.build.mk if ENABLE_TREEBROWSER geanyplugins_LTLIBRARIES = treebrowser.la -else -EXTRA_LTLIBRARIES = treebrowser.la endif treebrowser_la_SOURCES = treebrowser.c Modified: updatechecker/src/Makefile.am 2 files changed, 0 insertions(+), 2 deletions(-) =================================================================== @@ -3,8 +3,6 @@ plugin = updatechecker if ENABLE_UPDATECHECKER geanyplugins_LTLIBRARIES = updatechecker.la -else -EXTRA_LTLIBRARIES = updatechecker.la endif updatechecker_la_SOURCES = updatechecker.c Modified: webhelper/src/Makefile.am 2 files changed, 0 insertions(+), 2 deletions(-) =================================================================== @@ -3,8 +3,6 @@ plugin = webhelper if ENABLE_WEBHELPER geanyplugins_LTLIBRARIES = webhelper.la -else -EXTRA_LTLIBRARIES = webhelper.la endif Modified: xmlsnippets/src/Makefile.am 2 files changed, 0 insertions(+), 2 deletions(-) =================================================================== @@ -2,8 +2,6 @@ include $(top_srcdir)/build/vars.build.mk if ENABLE_XMLSNIPPETS geanyplugins_LTLIBRARIES = xmlsnippets.la -else -EXTRA_LTLIBRARIES = xmlsnippets.la endif xmlsnippets_la_SOURCES = \ @@ Diff output truncated at 100000 characters. @@ -------------- This E-Mail was brought to you by github_commit_mail.py (Source: TBD).
1
0
0
0
[geany/geany-plugins] a6ffeb: GeanyPG: Remove unused variables
by Frank Lanitz
16 Jun '12
16 Jun '12
Branch: refs/heads/master Author: Frank Lanitz <frank(a)frank.uvena.de> Committer: Frank Lanitz <frank(a)frank.uvena.de> Date: Sat, 16 Jun 2012 16:08:13 Commit: a6ffeb312c5d3527ea967c8f5d40273ff72dc6d8
https://github.com/geany/geany-plugins/commit/a6ffeb312c5d3527ea967c8f5d402…
Log Message: ----------- GeanyPG: Remove unused variables Modified Paths: -------------- geanypg/src/encrypt_cb.c Modified: geanypg/src/encrypt_cb.c 2 files changed, 0 insertions(+), 2 deletions(-) =================================================================== @@ -23,8 +23,6 @@ void geanypg_encrypt(encrypt_data * ed, gpgme_key_t * recp, int sign, int flags) { // FACTORIZE gpgme_data_t plain, cipher; - gpgme_encrypt_result_t result; - gpgme_invalid_key_t recipient; gpgme_error_t err; FILE * tempfile; tempfile = tmpfile(); @@ Diff output truncated at 100000 characters. @@ -------------- This E-Mail was brought to you by github_commit_mail.py (Source: TBD).
1
0
0
0
[geany/geany-plugins] c9da82: Fixed a bug noticed by Goran Andric which caused an error message to
by alvesh88
16 Jun '12
16 Jun '12
Branch: refs/heads/master Author: alvesh88 <alves.h88(a)gmail.com> Committer: Frank Lanitz <frank(a)frank.uvena.de> Date: Sat, 16 Jun 2012 16:05:43 Commit: c9da828736791220213bd14e2f17d6135c128f6f
https://github.com/geany/geany-plugins/commit/c9da828736791220213bd14e2f17d…
Log Message: ----------- Fixed a bug noticed by Goran Andric which caused an error message to appear when encrypting to an untrusted public key. Modified Paths: -------------- geanypg/ChangeLog geanypg/src/encrypt_cb.c geanypg/src/geanypg.h geanypg/src/helper_functions.c geanypg/src/verify_aux.c Modified: geanypg/ChangeLog 90 files changed, 90 insertions(+), 0 deletions(-) =================================================================== @@ -0,0 +1,90 @@ +2012-06-04 Hans Alves <alves(dot)h88(at)gmail(dot)com> + +* Fixed a bug that caused an error message to appear if one of the + keys used to encrypt are not trusted. + +2011-10-20 Colomban Wendling <colomban(at)geany(dot)org> + +* Fix a typo that broke the build + +2011-09-01 Hans Alves <alves(dot)h88(at)gmail(dot)com> + +* Adding documentation + +2011-09-01 Hans Alves <alves(dot)h88(at)gmail(dot)com> + +* Applied patch by sardenmff7 to fix bug 3344648 + +2011-08-15 Hans Alves <alves(dot)h88(at)gmail(dot)com> + +* Removed leading whitespace from a translatable string in pinentry.c + updated po/ChangeLog, some minor changes to the spanish translation + of geanypg and added a dutch translation + +2011-08-14 Hans Alves <alves(dot)h88(at)gmail(dot)com> + +* Added everything necessary for translation of geanypg and a spanish + translation. Also fixed a bug, when decrypting don't give an error + if no signatures are found. + +2011-08-14 Hans Alves <alves(dot)h88(at)gmail(dot)com> + +* changed Makefile.am to work with renamed aux.c + +2011-08-14 Hans Alves <alves(dot)h88(at)gmail(dot)com> + +* changed aux.c filename for windows compatibility + +2011-08-13 Hans Alves <alves(dot)h88(at)gmail(dot)com> + +* Fixed a bunch of compiler warnings about shadowing the global index + variable and discarding const qualifiers (string literals are const) + and fixed a function definition (geanypg_validity) which had a wrong + parameter type(gpgme_summary_t instead of gpgme_validity_t). + +2011-05-29 Enrico Tröger <enrico(dot)troeger(at)uvena(dot)de> + +* Set eol-style property globally + +2011-05-03 Enrico Tröger <enrico(dot)troeger(at)uvena(dot)de> + +* add check for large file support which is necessary for GPGME on 32bit + systems + +2011-04-14 Hans Alves <alves(dot)h88(at)gmail(dot)com> + +* Don't clear the document if encryption is cancelled. + +2011-04-06 Hans Alves <alves(dot)h88(at)gmail(dot)com> + +* Made the README file a bit more useful, and changed the COPYING file + to gpl version 2 instead of 3, so it is compatible with what the + source refers to and with the rest of the geany-plugins. + +2011-03-14 Colomban Wendling <colomban(at)geany(dot)org> + +* Statically analyze source code with cppcheck on `make check` + +2011-03-06 Chow Loong Jin <hyperair(at)ubuntu(dot)com> + +* Add ChangeLog, NEWS and README stubs for geanypg + +2011-03-06 Chow Loong Jin <hyperair(at)ubuntu(dot)com> + +* Integrate geanypg into build system + +2011-03-05 Enrico Tröger <enrico(dot)troeger(at)uvena(dot)de> + +* add Waf build support for new GeanyPG plugin + +2011-02-28 Hans Alves <alves(dot)h88(at)gmail(dot)com> + + * Moved geanypg to the geany-plugins/ directory + +2011-02-27 Hans Alves <alves(dot)h88(at)gmail(dot)com> + + * Added autoconf and automake files and some cleanup + +2011-02-26 Hans Alves <alves(dot)h88(at)gmail(dot)com> + + * Initial commit. Modified: geanypg/src/encrypt_cb.c 35 files changed, 28 insertions(+), 7 deletions(-) =================================================================== @@ -20,9 +20,11 @@ #include "geanypg.h" -void geanypg_encrypt(encrypt_data * ed, gpgme_key_t * recp, int sign) +void geanypg_encrypt(encrypt_data * ed, gpgme_key_t * recp, int sign, int flags) { // FACTORIZE gpgme_data_t plain, cipher; + gpgme_encrypt_result_t result; + gpgme_invalid_key_t recipient; gpgme_error_t err; FILE * tempfile; tempfile = tmpfile(); @@ -38,9 +40,9 @@ void geanypg_encrypt(encrypt_data * ed, gpgme_key_t * recp, int sign) // do the actual encryption if (sign) - err = gpgme_op_encrypt_sign(ed->ctx, recp, 0, plain, cipher); + err = gpgme_op_encrypt_sign(ed->ctx, recp, flags, plain, cipher); else - err = gpgme_op_encrypt(ed->ctx, recp, 0, plain, cipher); + err = gpgme_op_encrypt(ed->ctx, recp, flags, plain, cipher); if (err != GPG_ERR_NO_ERROR && gpgme_err_code(err) != GPG_ERR_CANCELED) geanypg_show_err_msg(err); else if(gpgme_err_code(err) != GPG_ERR_CANCELED) @@ -70,10 +72,29 @@ void geanypg_encrypt_cb(GtkMenuItem * menuitem, gpointer user_data) gpgme_key_t * recp = NULL; if (geanypg_encrypt_selection_dialog(&ed, &recp, &sign)) { - if (*recp) - geanypg_encrypt(&ed, recp, sign); - else if (dialogs_show_question(_("No recipients were selected,\nuse symetric cipher?"))) - geanypg_encrypt(&ed, NULL, sign); + int flags = 0; + int abort = 0; + gpgme_key_t * key = recp; + while (*key) + { + if ((*key)->owner_trust != GPGME_VALIDITY_ULTIMATE && + (*key)->owner_trust != GPGME_VALIDITY_FULL && + (*key)->owner_trust != GPGME_VALIDITY_MARGINAL) + { + if (dialogs_show_question(_("The key with user ID \"%s\" has validity \"%s\".\n\n" + "WARNING: It is NOT certain that the key belongs to the person named in the user ID.\n\n" + "Are you *really* sure you want to use this key anyway?"), + (*key)->uids->uid, geanypg_validity((*key)->owner_trust))) + flags = GPGME_ENCRYPT_ALWAYS_TRUST; + else + abort = 1; + } + ++key; + } + if (*recp && !abort) + geanypg_encrypt(&ed, recp, sign, flags); + else if (!abort && dialogs_show_question(_("No recipients were selected,\nuse symetric cipher?"))) + geanypg_encrypt(&ed, NULL, sign, flags); } if (recp) free(recp); Modified: geanypg/src/geanypg.h 3 files changed, 2 insertions(+), 1 deletions(-) =================================================================== @@ -53,7 +53,7 @@ enum extern GeanyData *geany_data; extern GeanyFunctions *geany_functions; -// auxiliary functions (aux.c) +// auxiliary functions (helper_functions.c) void geanypg_init_ed(encrypt_data * ed); int geanypg_get_keys(encrypt_data * ed); int geanypg_get_secret_keys(encrypt_data * ed); @@ -64,6 +64,7 @@ enum // some more auxiliary functions (verify_aux.c) void geanypg_handle_signatures(encrypt_data * ed, int need_error); void geanypg_check_sig(encrypt_data * ed, gpgme_signature_t sig); +const char * geanypg_validity(gpgme_validity_t validity); // dialogs int geanypg_encrypt_selection_dialog(encrypt_data * ed, gpgme_key_t ** selected, int * sign); Modified: geanypg/src/helper_functions.c 24 files changed, 20 insertions(+), 4 deletions(-) =================================================================== @@ -35,14 +35,22 @@ int geanypg_get_keys(encrypt_data * ed) //initialize idx to 0 unsigned long idx = 0; //allocate array of size 1N + gpgme_key_t * key; ed->key_array = (gpgme_key_t*) malloc(SIZE * sizeof(gpgme_key_t)); err = gpgme_op_keylist_start(ed->ctx, NULL, 0); while (!err) { - err = gpgme_op_keylist_next(ed->ctx, ed->key_array + idx); + key = ed->key_array + idx; + err = gpgme_op_keylist_next(ed->ctx, key); if (err) break; - ++idx; + if ((*key)->revoked || // key cannot be used + (*key)->expired || + (*key)->disabled || + (*key)->invalid) + gpgme_key_unref(*key); + else // key is valid + ++idx; if (idx >= size) { size += SIZE; @@ -65,14 +73,22 @@ int geanypg_get_secret_keys(encrypt_data * ed) //initialize idx to 0 unsigned long idx = 0; //allocate array of size 1N + gpgme_key_t * key; ed->skey_array = (gpgme_key_t*) malloc(SIZE * sizeof(gpgme_key_t)); err = gpgme_op_keylist_start(ed->ctx, NULL, 1); while (!err) { - err = gpgme_op_keylist_next(ed->ctx, ed->skey_array + idx); + key = ed->skey_array + idx; + err = gpgme_op_keylist_next(ed->ctx, key); if (err) break; - ++idx; + if ((*key)->revoked || // key cannot be used + (*key)->expired || + (*key)->disabled || + (*key)->invalid) + gpgme_key_unref(*key); + else // key is valid + ++idx; if (idx >= size) { size += SIZE; Modified: geanypg/src/verify_aux.c 2 files changed, 1 insertions(+), 1 deletions(-) =================================================================== @@ -58,7 +58,7 @@ void geanypg_get_keys_with_fp(encrypt_data * ed, char * buffer) } } -static const char * geanypg_validity(gpgme_validity_t validity) +const char * geanypg_validity(gpgme_validity_t validity) { switch (validity) { @@ Diff output truncated at 100000 characters. @@ -------------- This E-Mail was brought to you by github_commit_mail.py (Source: TBD).
1
0
0
0
[geany/geany-plugins] b5fe59: Merging 'cesspit/debugger'
by Frank Lanitz
16 Jun '12
16 Jun '12
Branch: refs/heads/master Author: Frank Lanitz <frank(a)frank.uvena.de> Committer: Frank Lanitz <frank(a)frank.uvena.de> Date: Sat, 16 Jun 2012 10:41:02 Commit: b5fe59c1738c25558c0fd14399cda962ef74d1bd
https://github.com/geany/geany-plugins/commit/b5fe59c1738c25558c0fd14399cda…
Log Message: ----------- Merging 'cesspit/debugger' A huge number of improvments and fixes Modified Paths: -------------- debugger/TODO debugger/src/atree.c debugger/src/atree.h debugger/src/bptree.c debugger/src/bptree.h debugger/src/breakpoint.c debugger/src/breakpoint.h debugger/src/breakpoints.c debugger/src/breakpoints.h debugger/src/btnpanel.c debugger/src/btnpanel.h debugger/src/callbacks.c debugger/src/callbacks.h debugger/src/calltip.h debugger/src/cell_renderers/cellrendererbreakicon.c debugger/src/cell_renderers/cellrendererframeicon.c debugger/src/cell_renderers/cellrenderertoggle.c debugger/src/dbm_gdb.c debugger/src/dconfig.c debugger/src/dconfig.h debugger/src/debug.c debugger/src/debug.h debugger/src/debug_module.c debugger/src/debug_module.h debugger/src/dpaned.c debugger/src/dpaned.h debugger/src/envtree.c debugger/src/envtree.h debugger/src/gui.c debugger/src/gui.h debugger/src/keys.c debugger/src/keys.h debugger/src/markers.c debugger/src/markers.h debugger/src/pixbuf.c debugger/src/pixbuf.h debugger/src/plugin.c debugger/src/stree.c debugger/src/stree.h debugger/src/tabs.h debugger/src/tpage.c debugger/src/tpage.h debugger/src/utils.c debugger/src/utils.h debugger/src/vtree.c debugger/src/vtree.h debugger/src/watch_model.c debugger/src/watch_model.h debugger/src/wtree.c debugger/src/wtree.h Modified: debugger/TODO 3 files changed, 3 insertions(+), 0 deletions(-) =================================================================== @@ -1,4 +1,6 @@ BUGS: +- panel buttons status change only after loading target file +- markers dissapear after refreshing a file (in other encoding for example) FEATURES: @@ -13,6 +15,7 @@ FEATURES: - margin context menu - editor context menu (add watch, add/remove breakpoint) +- refresh tooltip when stopping after step/run is tooltip is active - font from the geany settings for a message window - use left/right keys to collapse/expand in breakpoints tree - use lexer to lookup for a symbol under cursor when presenting a tooltip Modified: debugger/src/atree.c 1 files changed, 1 insertions(+), 0 deletions(-) =================================================================== @@ -25,6 +25,7 @@ #include <gtk/gtk.h> +#include "atree.h" #include "watch_model.h" #include "vtree.h" Modified: debugger/src/atree.h 10 files changed, 9 insertions(+), 1 deletions(-) =================================================================== @@ -18,6 +18,14 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301, USA. */ - + +#ifndef ATREE_H +#define ATREE_H + +#include <gtk/gtk.h> + +#include "watch_model.h" + GtkWidget* atree_init(watch_expanded_callback expanded, watch_button_pressed buttonpressed); +#endif /* guard */ Modified: debugger/src/bptree.c 187 files changed, 101 insertions(+), 86 deletions(-) =================================================================== @@ -81,10 +81,9 @@ enum /* * gets tree row reference for an unsected row at the same depth */ -GtkTreeRowReference* get_unselected_sibling(GtkTreePath *path) +static GtkTreeRowReference* get_unselected_sibling(GtkTreePath *path) { GtkTreeRowReference *sibling = NULL; - GtkTreeSelection *selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(tree)); /* move down find first unselected sibling */ @@ -156,18 +155,18 @@ static gboolean on_query_tooltip(GtkWidget *widget, gint x, gint y, gboolean key { gboolean show = FALSE; int bx, by; - gtk_tree_view_convert_widget_to_bin_window_coords(GTK_TREE_VIEW(widget), x, y, &bx, &by); - GtkTreePath *tpath = NULL; GtkTreeViewColumn *column = NULL; + + gtk_tree_view_convert_widget_to_bin_window_coords(GTK_TREE_VIEW(widget), x, y, &bx, &by); if (gtk_tree_view_get_path_at_pos(GTK_TREE_VIEW(widget), bx, by, &tpath, &column, NULL, NULL)) { if (1 == gtk_tree_path_get_depth(tpath) && column == gtk_tree_view_get_column(GTK_TREE_VIEW(widget), FILEPATH)) { GtkTreeIter iter; - gtk_tree_model_get_iter(model, &iter, tpath); - gchar *path = NULL; + + gtk_tree_model_get_iter(model, &iter, tpath); gtk_tree_model_get(model, &iter, FILEPATH, &path, -1); gtk_tooltip_set_text(tooltip, path); @@ -189,17 +188,20 @@ static void on_render_filename(GtkTreeViewColumn *tree_column, GtkCellRenderer * GtkTreeIter *iter, gpointer data) { gchar *path = NULL; + GtkTreePath *tpath; + gtk_tree_model_get(model, iter, FILEPATH, &path, -1); - GtkTreePath *tpath = gtk_tree_model_get_path(model, iter); + tpath = gtk_tree_model_get_path(model, iter); if (1 != gtk_tree_path_get_depth(tpath)) { g_object_set(cell, "text", path, NULL); } else { - const gchar *name = g_basename(path); + gchar *name = g_path_get_basename(path); g_object_set(cell, "text", name ? name : path, NULL); + g_free(name); } if (path) @@ -211,7 +213,7 @@ static void on_render_filename(GtkTreeViewColumn *tree_column, GtkCellRenderer * /* * hides file checkbox for breaks rows */ -void on_render_enable_for_file(GtkTreeViewColumn *tree_column, GtkCellRenderer *cell, GtkTreeModel *tree_model, +static void on_render_enable_for_file(GtkTreeViewColumn *tree_column, GtkCellRenderer *cell, GtkTreeModel *tree_model, GtkTreeIter *iter, gpointer data) { GtkTreePath *path = gtk_tree_model_get_path(model, iter); @@ -222,7 +224,7 @@ void on_render_enable_for_file(GtkTreeViewColumn *tree_column, GtkCellRenderer * /* * hides break pixbuf for file rows */ -void on_render_enable_break(GtkTreeViewColumn *tree_column, GtkCellRenderer *cell, GtkTreeModel *tree_model, +static void on_render_enable_break(GtkTreeViewColumn *tree_column, GtkCellRenderer *cell, GtkTreeModel *tree_model, GtkTreeIter *iter, gpointer data) { GtkTreePath *path = gtk_tree_model_get_path(model, iter); @@ -233,7 +235,7 @@ void on_render_enable_break(GtkTreeViewColumn *tree_column, GtkCellRenderer *cel /* * makes condition and hitscount uneditable and empty for file rows */ -void on_render(GtkTreeViewColumn *tree_column, GtkCellRenderer *cell, GtkTreeModel *tree_model, +static void on_render(GtkTreeViewColumn *tree_column, GtkCellRenderer *cell, GtkTreeModel *tree_model, GtkTreeIter *iter, gpointer data) { GtkTreePath *path = gtk_tree_model_get_path(model, iter); @@ -258,21 +260,20 @@ void on_render(GtkTreeViewColumn *tree_column, GtkCellRenderer *cell, GtkTreeMod */ static void on_row_double_click(GtkTreeView *tree_view, GtkTreePath *path, GtkTreeViewColumn *column, gpointer user_data) { + GtkTreeIter iter, parent_iter; + gchar *file; + int line; + if (1 == gtk_tree_path_get_depth(path)) { return; } - GtkTreeIter iter; gtk_tree_model_get_iter ( model, &iter, path); - - gchar *file; - int line; - GtkTreeIter parent_iter; gtk_tree_model_iter_parent(model, &parent_iter, &iter); gtk_tree_model_get ( @@ -296,28 +297,27 @@ static void on_row_double_click(GtkTreeView *tree_view, GtkTreePath *path, GtkTr /* * editing "condition" column value finished */ -void on_condition_changed(GtkCellRendererText *renderer, gchar *path, gchar *new_text, gpointer user_data) +static void on_condition_changed(GtkCellRendererText *renderer, gchar *path, gchar *new_text, gpointer user_data) { - GtkTreeIter iter; - GtkTreePath *tree_path = gtk_tree_path_new_from_string (path); + gchar *file; + int line; + gchar* oldcondition; + GtkTreeIter iter, parent_iter; + GtkTreePath *tree_path = gtk_tree_path_new_from_string (path); gtk_tree_model_get_iter ( model, &iter, tree_path); - GtkTreeIter parent_iter; gtk_tree_model_iter_parent(model, &parent_iter, &iter); - gchar *file; gtk_tree_model_get ( model, &parent_iter, FILEPATH, &file, -1); - int line; - gchar* oldcondition; gtk_tree_model_get ( model, &iter, @@ -336,32 +336,33 @@ void on_condition_changed(GtkCellRendererText *renderer, gchar *path, gchar *new /* * editing "hitscount" column value finished */ -void on_hitscount_changed(GtkCellRendererText *renderer, gchar *path, gchar *new_text, gpointer user_data) +static void on_hitscount_changed(GtkCellRendererText *renderer, gchar *path, gchar *new_text, gpointer user_data) { + GtkTreeIter iter, parent_iter; + GtkTreePath *tree_path; + gchar *file; + int line; + gint oldcount; int count = atoi(new_text); + if (!count && strcmp(new_text, "0")) return; - GtkTreeIter iter; - GtkTreePath *tree_path = gtk_tree_path_new_from_string (path); + tree_path = gtk_tree_path_new_from_string (path); gtk_tree_model_get_iter ( model, &iter, tree_path); - GtkTreeIter parent_iter; gtk_tree_model_iter_parent(model, &parent_iter, &iter); - gchar *file; gtk_tree_model_get ( model, &parent_iter, FILEPATH, &file, -1); - int line; - gint oldcount; gtk_tree_model_get ( model, &iter, @@ -379,21 +380,24 @@ void on_hitscount_changed(GtkCellRendererText *renderer, gchar *path, gchar *new /* * enable / disable all breaks for a file when it's checkbox icon has been clicked */ -void on_enable_for_file(GtkCellRendererToggle *cell_renderer, gchar *path, gpointer user_data) +static void on_enable_for_file(GtkCellRendererToggle *cell_renderer, gchar *path, gpointer user_data) { + GtkTreeIter iter; + GtkTreePath *tree_path; + gboolean current_state; + /* do not process event is page is readonly (debug is running) */ if (readonly) return; - GtkTreeIter iter; - GtkTreePath *tree_path = gtk_tree_path_new_from_string (path); + tree_path = gtk_tree_path_new_from_string (path); gtk_tree_model_get_iter ( model, &iter, tree_path); - gboolean current_state = gtk_cell_renderer_toggle_get_active(cell_renderer); + current_state = gtk_cell_renderer_toggle_get_active(cell_renderer); /* check if this is a file row */ if(1 == gtk_tree_path_get_depth(tree_path)) @@ -416,14 +420,16 @@ void on_enable_for_file(GtkCellRendererToggle *cell_renderer, gchar *path, gpoin /* * enable / disable particulary break when it's icon has been clicked */ -void on_enable_break(CellRendererBreakIcon *cell_renderer, gchar *path, gpointer user_data) +static void on_enable_break(CellRendererBreakIcon *cell_renderer, gchar *path, gpointer user_data) { + GtkTreeIter iter; + GtkTreePath *tree_path; + /* do not process event is page is readonly (debug is running) */ if (readonly) return; - GtkTreeIter iter; - GtkTreePath *tree_path = gtk_tree_path_new_from_string (path); + tree_path = gtk_tree_path_new_from_string (path); gtk_tree_model_get_iter ( model, @@ -433,11 +439,11 @@ void on_enable_break(CellRendererBreakIcon *cell_renderer, gchar *path, gpointer /* check if this is not a file row */ if(1 != gtk_tree_path_get_depth(tree_path)) { - GtkTreeIter parent_iter; - gtk_tree_model_iter_parent(model, &parent_iter, &iter); - gchar *file; int line; + GtkTreeIter parent_iter; + + gtk_tree_model_iter_parent(model, &parent_iter, &iter); gtk_tree_model_get ( model, @@ -463,24 +469,28 @@ void on_enable_break(CellRendererBreakIcon *cell_renderer, gchar *path, gpointer */ static gboolean on_key_pressed(GtkWidget *widget, GdkEvent *event, gpointer user_data) { + guint keyval = ((GdkEventKey*)event)->keyval; + GtkTreeSelection *selection; + GList *rows; + /* do not process event is page is readonly (debug is running) */ if (readonly) return FALSE; - guint keyval = ((GdkEventKey*)event)->keyval; - /* get selected rows */ - GtkTreeSelection *selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(tree)); - GList *rows = gtk_tree_selection_get_selected_rows(selection, &model); + selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(tree)); + rows = gtk_tree_selection_get_selected_rows(selection, &model); rows = g_list_sort(rows, (GCompareFunc)gtk_tree_path_compare); if (keyval == GDK_Delete && rows && g_list_length(rows)) { + GList *breaks, *iter; + GtkTreeRowReference *new_selection = NULL; + GtkTreePath *first_path = (GtkTreePath*)rows->data; + /* "delete selected rows" */ /* get new selection */ - GtkTreeRowReference *new_selection = NULL; - GtkTreePath *first_path = (GtkTreePath*)rows->data; if (gtk_tree_path_get_depth(first_path) > 1) { new_selection = get_unselected_sibling(first_path); @@ -498,13 +508,12 @@ static gboolean on_key_pressed(GtkWidget *widget, GdkEvent *event, gpointer user /* collect GList of breakpoints to remove if file row is met - add all unselected breaks to the list as well */ - GList *iter = rows; - GList *breaks = NULL; - while (iter) + breaks = NULL; + for (iter = rows; iter; iter = iter->next) { GtkTreePath *path = (GtkTreePath*)iter->data; - GtkTreeIter titer; + gtk_tree_model_get_iter(model, &titer, path); if (1 == gtk_tree_path_get_depth(path)) @@ -518,11 +527,12 @@ static gboolean on_key_pressed(GtkWidget *widget, GdkEvent *event, gpointer user { gchar *file = NULL; gint line; + breakpoint *bp; gtk_tree_model_get(model, &titer, FILEPATH, &file, -1); gtk_tree_model_get(model, &citer, LINE, &line, -1); - breakpoint *bp = breaks_lookup_breakpoint(file, line); + bp = breaks_lookup_breakpoint(file, line); breaks = g_list_append(breaks, bp); @@ -534,21 +544,22 @@ static gboolean on_key_pressed(GtkWidget *widget, GdkEvent *event, gpointer user else { GtkTreeIter piter; + gchar *file = NULL; + gint line; + breakpoint *bp; + gtk_tree_model_iter_parent(model, &piter, &titer); - gchar *file = NULL; gtk_tree_model_get(model, &piter, FILEPATH, &file, -1); - gint line; gtk_tree_model_get(model, &titer, LINE, &line, -1); - breakpoint *bp = breaks_lookup_breakpoint(file, line); + bp = breaks_lookup_breakpoint(file, line); breaks = g_list_append(breaks, bp); g_free(file); } - iter = iter->next; } if (1 == g_list_length(breaks)) @@ -594,6 +605,10 @@ static gboolean on_key_pressed(GtkWidget *widget, GdkEvent *event, gpointer user */ gboolean bptree_init(move_to_line_cb cb) { + GtkTreeSelection *selection; + GtkTreeViewColumn *column; + GtkCellRenderer *renderer; + /* save double click callback */ on_break_clicked = cb; @@ -622,7 +637,7 @@ gboolean bptree_init(move_to_line_cb cb) gtk_tree_view_set_headers_visible(GTK_TREE_VIEW(tree), 1); gtk_widget_set_has_tooltip(GTK_WIDGET(tree), TRUE); /* multiple selection */ - GtkTreeSelection *selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(tree)); + selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(tree)); gtk_tree_selection_set_mode(selection, GTK_SELECTION_MULTIPLE); /* connect signals */ @@ -631,33 +646,32 @@ gboolean bptree_init(move_to_line_cb cb) g_signal_connect(G_OBJECT(tree), "query-tooltip", G_CALLBACK (on_query_tooltip), NULL); /* creating columns */ - GtkTreeViewColumn *column; /* icon, file */ - GtkCellRenderer *renderer = gtk_cell_renderer_text_new (); + renderer = gtk_cell_renderer_text_new (); column = gtk_tree_view_column_new(); gtk_tree_view_column_pack_end(column, renderer, TRUE); gtk_tree_view_column_set_cell_data_func(column, renderer, on_render_filename, NULL, NULL); - + /* enable for file */ - GtkCellRenderer *file_enable_renderer = cell_renderer_toggle_new (); - g_signal_connect (G_OBJECT(file_enable_renderer), "toggled", G_CALLBACK(on_enable_for_file), NULL); - gtk_tree_view_column_pack_end(column, file_enable_renderer, FALSE); - gtk_tree_view_column_set_attributes(column, file_enable_renderer, "active", ENABLED, NULL); - gtk_tree_view_column_set_cell_data_func(column, file_enable_renderer, on_render_enable_for_file, NULL, NULL); + renderer = cell_renderer_toggle_new (); + g_signal_connect (G_OBJECT(renderer), "toggled", G_CALLBACK(on_enable_for_file), NULL); + gtk_tree_view_column_pack_end(column, renderer, FALSE); + gtk_tree_view_column_set_attributes(column, renderer, "active", ENABLED, NULL); + gtk_tree_view_column_set_cell_data_func(column, renderer, on_render_enable_for_file, NULL, NULL); /* enable breakpoint */ - GtkCellRenderer *break_enable_renderer = cell_renderer_break_icon_new (); - g_signal_connect (G_OBJECT(break_enable_renderer), "clicked", G_CALLBACK(on_enable_break), NULL); + renderer = cell_renderer_break_icon_new (); + g_signal_connect (G_OBJECT(renderer), "clicked", G_CALLBACK(on_enable_break), NULL); - g_object_set(break_enable_renderer, "pixbuf_enabled", (gpointer)break_pixbuf, NULL); - g_object_set(break_enable_renderer, "pixbuf_disabled", (gpointer)break_disabled_pixbuf, NULL); - g_object_set(break_enable_renderer, "pixbuf_conditional", (gpointer)break_condition_pixbuf, NULL); - g_object_set(break_enable_renderer, "pixbuf_file", (gpointer)break_pixbuf, NULL); + g_object_set(renderer, "pixbuf_enabled", (gpointer)break_pixbuf, NULL); + g_object_set(renderer, "pixbuf_disabled", (gpointer)break_disabled_pixbuf, NULL); + g_object_set(renderer, "pixbuf_conditional", (gpointer)break_condition_pixbuf, NULL); + g_object_set(renderer, "pixbuf_file", (gpointer)break_pixbuf, NULL); - gtk_tree_view_column_pack_end(column, break_enable_renderer, FALSE); - gtk_tree_view_column_set_attributes(column, break_enable_renderer, "enabled", ENABLED, "condition", CONDITION, "hitscount", HITSCOUNT, NULL); - gtk_tree_view_column_set_cell_data_func(column, break_enable_renderer, on_render_enable_break, NULL, NULL); + gtk_tree_view_column_pack_end(column, renderer, FALSE); + gtk_tree_view_column_set_attributes(column, renderer, "enabled", ENABLED, "condition", CONDITION, "hitscount", HITSCOUNT, NULL); + gtk_tree_view_column_set_cell_data_func(column, renderer, on_render_enable_break, NULL, NULL); gtk_tree_view_column_set_title(column, _("Location")); gtk_tree_view_column_set_resizable (column, TRUE); @@ -675,9 +689,8 @@ gboolean bptree_init(move_to_line_cb cb) /* hits count */ hcount_renderer = gtk_cell_renderer_spin_new (); - GtkAdjustment* adj = GTK_ADJUSTMENT (gtk_adjustment_new (0.0, 0.0, 100000.0, 1.0, 2.0, 2.0)); g_object_set (hcount_renderer, - "adjustment", adj, + "adjustment", gtk_adjustment_new (0.0, 0.0, 100000.0, 1.0, 2.0, 2.0), "digits", 0, NULL); g_signal_connect (G_OBJECT (hcount_renderer), "edited", G_CALLBACK (on_hitscount_changed), NULL); column = gtk_tree_view_column_new_with_attributes (_("Hit count"), hcount_renderer, "text", HITSCOUNT, NULL); @@ -709,7 +722,7 @@ gboolean bptree_init(move_to_line_cb cb) * destroy breaks tree and associated data * arguments: */ -void bptree_destroy() +void bptree_destroy(void) { g_hash_table_destroy(files); } @@ -721,9 +734,10 @@ void bptree_destroy() */ void bptree_set_enabled(breakpoint *bp) { + GtkTreeIter parent; + gtk_tree_store_set(store, &(bp->iter), ENABLED, bp->enabled, -1); - GtkTreeIter parent; gtk_tree_model_iter_parent(model, &parent, &(bp->iter)); update_file_node(&parent); } @@ -756,7 +770,7 @@ void bptree_set_condition(breakpoint* bp) */ gchar* bptree_get_condition(breakpoint *bp) { - gchar *condition; + gchar *condition; gtk_tree_model_get ( model, &(bp->iter), @@ -785,17 +799,20 @@ void bptree_set_readonly(gboolean value) */ void bptree_add_breakpoint(breakpoint* bp) { - GtkTreeIter file_iter; + GtkTreeIter file_iter, iter, child, *sibling = NULL; GtkTreeRowReference *file_reference = (GtkTreeRowReference*)g_hash_table_lookup(files, bp->file); + if (!file_reference) { + GtkTreePath *file_path; + gtk_tree_store_prepend (store, &file_iter, NULL); gtk_tree_store_set (store, &file_iter, FILEPATH, bp->file, ENABLED, TRUE, -1); - GtkTreePath *file_path = gtk_tree_model_get_path(model, &file_iter); + file_path = gtk_tree_model_get_path(model, &file_iter); file_reference = gtk_tree_row_reference_new(model, file_path); gtk_tree_path_free(file_path); @@ -809,7 +826,6 @@ void bptree_add_breakpoint(breakpoint* bp) } /* lookup where to insert new row */ - GtkTreeIter child, *sibling = NULL; if(gtk_tree_model_iter_children(model, &child, &file_iter)) { do @@ -829,11 +845,10 @@ void bptree_add_breakpoint(breakpoint* bp) while(gtk_tree_model_iter_next(model, &child)); } - GtkTreeIter iter; gtk_tree_store_insert_before(store, &iter, &file_iter, sibling); - bp->iter = iter; - - bptree_update_breakpoint(bp); + bp->iter = iter; + + bptree_update_breakpoint(bp); } /* @@ -883,7 +898,7 @@ void bptree_remove_breakpoint(breakpoint* bp) * updates all file ENABLED checkboxes base on theit children states * arguments: */ -void bptree_update_file_nodes() +void bptree_update_file_nodes(void) { GtkTreeIter file; if(gtk_tree_model_iter_children(model, &file, NULL)) Modified: debugger/src/bptree.h 14 files changed, 12 insertions(+), 2 deletions(-) =================================================================== @@ -19,8 +19,16 @@ * MA 02110-1301, USA. */ +#ifndef BPTREE_H +#define BPTREE_H + +#include <glib.h> + +#include "breakpoint.h" +#include "breakpoints.h" + gboolean bptree_init(move_to_line_cb callback); -void bptree_destroy(); +void bptree_destroy(void); void bptree_add_breakpoint(breakpoint* bp); void bptree_update_breakpoint(breakpoint* bp); void bptree_remove_breakpoint(breakpoint* bp); @@ -29,4 +37,6 @@ void bptree_set_enabled(breakpoint* bp); gchar* bptree_get_condition(breakpoint* bp); void bptree_set_readonly(gboolean readonly); -void bptree_update_file_nodes(); +void bptree_update_file_nodes(void); + +#endif /* guard */ Modified: debugger/src/breakpoint.c 2 files changed, 1 insertions(+), 1 deletions(-) =================================================================== @@ -30,7 +30,7 @@ /* * create new empty breakpoint */ -breakpoint* break_new() +breakpoint* break_new(void) { breakpoint* bp = (breakpoint*)g_malloc(sizeof(breakpoint)); memset(bp, 0 , sizeof(breakpoint)); Modified: debugger/src/breakpoint.h 12 files changed, 10 insertions(+), 2 deletions(-) =================================================================== @@ -18,7 +18,13 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301, USA. */ - + +#ifndef BREAKPOINT_H +#define BREAKPOINT_H + +#include <glib.h> +#include <gtk/gtk.h> + /* maximum condition length */ #define CONDITION_MAX_LENGTH 1024 @@ -32,5 +38,7 @@ GtkTreeIter iter; } breakpoint; -breakpoint* break_new(); +breakpoint* break_new(void); breakpoint* break_new_full(const char* file, int line, const char* condition, int enabled, int hitscount); + +#endif /* guard */ Modified: debugger/src/breakpoints.c 58 files changed, 34 insertions(+), 24 deletions(-) =================================================================== @@ -49,7 +49,7 @@ /* * Iterates through GTree for the particular file */ -gboolean tree_foreach_call_function(gpointer key, gpointer value, gpointer data) +static gboolean tree_foreach_call_function(gpointer key, gpointer value, gpointer data) { ((breaks_iterate_function)data)(value); return FALSE; @@ -58,7 +58,7 @@ gboolean tree_foreach_call_function(gpointer key, gpointer value, gpointer data) /* * Iterates through hash table of GTree-s */ -void hash_table_foreach_call_function(gpointer key, gpointer value, gpointer user_data) +static void hash_table_foreach_call_function(gpointer key, gpointer value, gpointer user_data) { g_tree_foreach((GTree*)value, tree_foreach_call_function, user_data); } @@ -67,7 +67,7 @@ void hash_table_foreach_call_function(gpointer key, gpointer value, gpointer use * Iterates through GTree * adding each item to GList that is passed through data variable */ -gboolean tree_foreach_add_to_list(gpointer key, gpointer value, gpointer data) +static gboolean tree_foreach_add_to_list(gpointer key, gpointer value, gpointer data) { GList **list = (GList**)data; *list = g_list_append(*list, value); @@ -78,7 +78,7 @@ gboolean tree_foreach_add_to_list(gpointer key, gpointer value, gpointer data) * Iterates through hash table of GTree-s * calling list collection functions on each tree */ -void hash_table_foreach_add_to_list(gpointer key, gpointer value, gpointer user_data) +static void hash_table_foreach_add_to_list(gpointer key, gpointer value, gpointer user_data) { g_tree_foreach((GTree*)value, tree_foreach_add_to_list, user_data); } @@ -96,12 +96,14 @@ static void on_add(breakpoint *bp) } static void on_remove(breakpoint *bp) { + GTree *tree; + /* remove marker */ markers_remove_breakpoint(bp); /* remove from breakpoints tab */ bptree_remove_breakpoint(bp); /* remove from internal storage */ - GTree *tree = g_hash_table_lookup(files, bp->file); + tree = g_hash_table_lookup(files, bp->file); g_tree_remove(tree, GINT_TO_POINTER(bp->line)); } static void on_set_hits_count(breakpoint *bp) @@ -168,7 +170,7 @@ static void on_remove_list(GList *list) * b - second integer * user_data - not used */ -gint compare_func(gconstpointer a, gconstpointer b, gpointer user_data) +static gint compare_func(gconstpointer a, gconstpointer b, gpointer user_data) { return GPOINTER_TO_INT(a) - GPOINTER_TO_INT(b); } @@ -330,7 +332,7 @@ gboolean breaks_init(move_to_line_cb cb) /* * Frees breaks related data. */ -void breaks_destroy() +void breaks_destroy(void) { /* remove all markers */ GList *breaks, *iter; @@ -360,17 +362,19 @@ void breaks_destroy() */ void breaks_add(const char* file, int line, char* condition, int enabled, int hitscount) { + GTree *tree; + breakpoint* bp; + enum dbs state = debug_get_state(); + /* do not process async break manipulation on modules that do not support async interuppt */ - enum dbs state = debug_get_state(); if (DBS_RUNNING == state && !debug_supports_async_breaks()) return; /* allocate memory */ - breakpoint* bp = break_new_full(file, line, condition, enabled, hitscount); + bp = break_new_full(file, line, condition, enabled, hitscount); /* check whether GTree for this file exists and create if doesn't */ - GTree *tree; if (!(tree = g_hash_table_lookup(files, bp->file))) { char *newfile = g_strdup(bp->file); @@ -402,14 +406,15 @@ void breaks_add(const char* file, int line, char* condition, int enabled, int hi */ void breaks_remove(const char* file, int line) { + breakpoint* bp = NULL; + enum dbs state = debug_get_state(); + /* do not process async break manipulation on modules that do not support async interuppt */ - enum dbs state = debug_get_state(); if (DBS_RUNNING == state && !debug_supports_async_breaks()) return; /* lookup for breakpoint */ - breakpoint* bp = NULL; if (!(bp = breaks_lookup_breakpoint(file, line))) return; @@ -458,7 +463,7 @@ void breaks_remove_list(GList *list) * Removes all breakpoints. * arguments: */ -void breaks_remove_all() +void breaks_remove_all(void) { g_hash_table_foreach(files, hash_table_foreach_call_function, (gpointer)on_remove); g_hash_table_remove_all(files); @@ -470,15 +475,17 @@ void breaks_remove_all() * file - list of breakpoints * enabled - anble or disable breakpoints */ -void breaks_set_enabled_for_file(const const char *file, gboolean enabled) +void breaks_set_enabled_for_file(const char *file, gboolean enabled) { + GList *breaks; + enum dbs state = debug_get_state(); + /* do not process async break manipulation on modules that do not support async interuppt */ - enum dbs state = debug_get_state(); if (DBS_RUNNING == state && !debug_supports_async_breaks()) return; - GList *breaks = breaks_get_for_document(file); + breaks = breaks_get_for_document(file); /* handle switching instantly if debugger is idle or stopped and request debug module interruption overwise */ @@ -502,14 +509,15 @@ void breaks_set_enabled_for_file(const const char *file, gboolean enabled) */ void breaks_switch(const char* file, int line) { + breakpoint* bp = NULL; + enum dbs state = debug_get_state(); + /* do not process async break manipulation on modules that do not support async interuppt */ - enum dbs state = debug_get_state(); if (DBS_RUNNING == state && !debug_supports_async_breaks()) return; /* lookup for breakpoint */ - breakpoint* bp = NULL; if (!(bp = breaks_lookup_breakpoint(file, line))) return; @@ -538,14 +546,15 @@ void breaks_switch(const char* file, int line) */ void breaks_set_hits_count(const char* file, int line, int count) { + breakpoint* bp = NULL; + enum dbs state = debug_get_state(); + /* do not process async break manipulation on modules that do not support async interuppt */ - enum dbs state = debug_get_state(); if (DBS_RUNNING == state && !debug_supports_async_breaks()) return; /* lookup for breakpoint */ - breakpoint* bp = NULL; if (!(bp = breaks_lookup_breakpoint(file, line))) return; @@ -574,14 +583,15 @@ void breaks_set_hits_count(const char* file, int line, int count) */ void breaks_set_condition(const char* file, int line, const char* condition) { + breakpoint* bp = NULL; + enum dbs state = debug_get_state(); + /* do not process async break manipulation on modules that do not support async interuppt */ - enum dbs state = debug_get_state(); if (DBS_RUNNING == state && !debug_supports_async_breaks()) return; /* lookup for breakpoint */ - breakpoint* bp = NULL; if (!(bp = breaks_lookup_breakpoint(file, line))) return; @@ -637,9 +647,9 @@ void breaks_move_to_line(const char* file, int line_from, int line_to) break_state breaks_get_state(const char* file, int line) { break_state bs = BS_NOT_SET; + GTree *tree; /* first look for the tree for the given file */ - GTree *tree; if ( (tree = g_hash_table_lookup(files, file)) ) { breakpoint *bp = g_tree_lookup(tree, GINT_TO_POINTER(line)); @@ -688,7 +698,7 @@ breakpoint* breaks_lookup_breakpoint(const gchar* file, int line) * Gets all breakpoints * arguments: */ -GList* breaks_get_all() +GList* breaks_get_all(void) { GList *breaks = NULL; g_hash_table_foreach(files, hash_table_foreach_add_to_list, &breaks); Modified: debugger/src/breakpoints.h 15 files changed, 11 insertions(+), 4 deletions(-) =================================================================== @@ -19,6 +19,11 @@ * MA 02110-1301, USA. */ +#ifndef BREAKPOINTS_H +#define BREAKPOINTS_H + +#include <glib.h> + #include "breakpoint.h" typedef enum _break_state { @@ -31,17 +36,19 @@ typedef void (*select_frame_cb)(int frame_number); gboolean breaks_init(move_to_line_cb callback); -void breaks_destroy(); +void breaks_destroy(void); void breaks_add(const char* file, int line, char* condition, int enable, int hitscount); void breaks_remove(const char* file, int line); void breaks_remove_list(GList *list); -void breaks_remove_all(); +void breaks_remove_all(void); void breaks_switch(const char *file, int line); void breaks_set_hits_count(const char *file, int line, int count); void breaks_set_condition(const char *file, int line, const char* condition); -void breaks_set_enabled_for_file(const const char *file, gboolean enabled); +void breaks_set_enabled_for_file(const char *file, gboolean enabled); void breaks_move_to_line(const char* file, int line_from, int line_to); break_state breaks_get_state(const char* file, int line); GList* breaks_get_for_document(const char* file); -GList* breaks_get_all(); +GList* breaks_get_all(void); breakpoint* breaks_lookup_breakpoint(const gchar* file, int line); + +#endif /* guard */ Modified: debugger/src/btnpanel.c 4 files changed, 2 insertions(+), 2 deletions(-) =================================================================== @@ -60,7 +60,7 @@ /* * calls settings dialog */ -void on_settings(GtkButton *button, gpointer user_data) +static void on_settings(GtkButton *button, gpointer user_data) { plugin_show_configure(geany_plugin); } @@ -68,7 +68,7 @@ void on_settings(GtkButton *button, gpointer user_data) /* * gets current file and line and calls debug function */ -void on_execute_until(GtkButton *button, gpointer user_data) +static void on_execute_until(GtkButton *button, gpointer user_data) { GeanyDocument *doc = document_get_current(); if (doc) Modified: debugger/src/btnpanel.h 10 files changed, 10 insertions(+), 0 deletions(-) =================================================================== @@ -19,7 +19,17 @@ * MA 02110-1301, USA. */ +#ifndef BTNPANEL_H +#define BTNPANEL_H + +#include <glib.h> +#include <gtk/gtk.h> + +#include "debug_module.h" + typedef void (*on_toggle)(GtkToggleButton *button, gpointer user_data); GtkWidget* btnpanel_create(on_toggle cb); void btnpanel_set_debug_state(enum dbs state); + +#endif /* guard */ Modified: debugger/src/callbacks.c 19 files changed, 12 insertions(+), 7 deletions(-) =================================================================== @@ -31,6 +31,7 @@ #endif #include <geanyplugin.h> +#include "callbacks.h" #include "breakpoints.h" #include "debug.h" #include "keys.h" @@ -48,7 +49,7 @@ /* * Set breakpoint and stack markers for a file */ -void set_markers_for_file(const gchar* file) +static void set_markers_for_file(const gchar* file) { GList *breaks; if ( (breaks = breaks_get_for_document(file)) ) @@ -116,7 +117,6 @@ void on_document_before_save(GObject *obj, GeanyDocument *doc, gpointer user_dat /* * Occures on saving document */ -void on_document_open(GObject *obj, GeanyDocument *doc, gpointer user_data); void on_document_save(GObject *obj, GeanyDocument *doc, gpointer user_data) { if (_unexisting_file) @@ -187,13 +187,17 @@ gboolean on_editor_notify( { case SCN_MARGINCLICK: { + char* file; + int line; + break_state bs; + if (!editor->document->real_path || 1 != nt->margin) break; - char* file = editor->document->file_name; - int line = sci_get_line_from_position(editor->sci, nt->position) + 1; + file = editor->document->file_name; + line = sci_get_line_from_position(editor->sci, nt->position) + 1; - break_state bs = breaks_get_state(file, line); + bs = breaks_get_state(file, line); if (BS_NOT_SET == bs) breaks_add(file, line, NULL, TRUE, 0); else if (BS_ENABLED == bs) @@ -207,12 +211,13 @@ gboolean on_editor_notify( } case SCN_DWELLSTART: { + GString *word; + if (DBS_STOPPED != debug_get_state ()) break; /* get a word under the cursor */ - GString *word = get_word_at_position(editor->sci, nt->position); - + word = get_word_at_position(editor->sci, nt->position); if (word->len) { gchar *calltip = debug_get_calltip_for_expression(word->str); Modified: debugger/src/callbacks.h 9 files changed, 9 insertions(+), 0 deletions(-) =================================================================== @@ -19,8 +19,17 @@ * MA 02110-1301, USA. */ +#ifndef CALLBACKS_H +#define CALLBACKS_H + +#include <glib.h> +#include <glib-object.h> +#include "geanyplugin.h" + void on_document_open(GObject *obj, GeanyDocument *doc, gpointer user_data); void on_document_save(GObject *obj, GeanyDocument *doc, gpointer user_data); void on_document_before_save(GObject *obj, GeanyDocument *doc, gpointer user_data); gboolean on_editor_notify(GObject *object, GeanyEditor *editor, SCNotification *nt, gpointer data); gboolean keys_callback(guint key_id); + +#endif /* guard */ Modified: debugger/src/calltip.h 11 files changed, 10 insertions(+), 1 deletions(-) =================================================================== @@ -18,8 +18,17 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301, USA. */ - + +#ifndef CALLTIP_H +#define CALLTIP_H + +#include <glib.h> + +#include "debug_module.h" + #define MAX_CALLTIP_LENGTH 140 #define MAX_CALLTIP_HEIGHT 20 GString* get_calltip_line(variable *var, gboolean firstline); + +#endif /* guard */ Modified: debugger/src/cell_renderers/cellrendererbreakicon.c 15 files changed, 10 insertions(+), 5 deletions(-) =================================================================== @@ -278,12 +278,12 @@ static gint cell_renderer_break_icon_activate(GtkCellRenderer *cell, GdkEvent *e */ static void cell_renderer_break_icon_init (CellRendererBreakIcon *cell) { + GtkCellRenderer *cell_renderer = (GtkCellRenderer*)cell; + cell->enabled = TRUE; cell->condition = NULL; cell->hitscount = 0; - GtkCellRenderer *cell_renderer = (GtkCellRenderer*)cell; - cell_renderer->mode = GTK_CELL_RENDERER_MODE_ACTIVATABLE; cell->pixbuf_enabled = cell->pixbuf_disabled = cell->pixbuf_conditional = cell->pixbuf_file = 0; @@ -295,9 +295,14 @@ static void cell_renderer_break_icon_init (CellRendererBreakIcon *cell) static void cell_renderer_break_icon_finalize (GObject *object) { CellRendererBreakIcon *cell = (CellRendererBreakIcon*)object; - - GdkPixbuf *pixbufs[] = { cell->pixbuf_enabled, cell->pixbuf_disabled, cell->pixbuf_conditional, cell->pixbuf_file }; + GdkPixbuf *pixbufs[4]; int i; + + pixbufs[0] = cell->pixbuf_enabled; + pixbufs[1] = cell->pixbuf_disabled; + pixbufs[2] = cell->pixbuf_conditional; + pixbufs[3] = cell->pixbuf_file; + for(i = 0; i < 4; i++) { if (pixbufs[i]) @@ -449,7 +454,7 @@ GType cell_renderer_break_icon_get_type(void) /* * creates new renderer */ -GtkCellRenderer* cell_renderer_break_icon_new() +GtkCellRenderer* cell_renderer_break_icon_new(void) { return g_object_new(TYPE_CELL_RENDERER_BREAK_ICON, NULL); } Modified: debugger/src/cell_renderers/cellrendererframeicon.c 13 files changed, 8 insertions(+), 5 deletions(-) =================================================================== @@ -222,10 +222,10 @@ static void cell_renderer_frame_icon_render(GtkCellRenderer *cell, GdkDrawable * */ static void cell_renderer_frame_icon_init (CellRendererFrameIcon *cell) { - cell->active_frame = FALSE; - GtkCellRenderer *cell_renderer = (GtkCellRenderer*)cell; + cell->active_frame = FALSE; + cell_renderer->mode = GTK_CELL_RENDERER_MODE_ACTIVATABLE; cell->pixbuf_active = cell->pixbuf_highlighted = 0; @@ -237,9 +237,12 @@ static void cell_renderer_frame_icon_init (CellRendererFrameIcon *cell) static void cell_renderer_frame_icon_finalize (GObject *object) { CellRendererFrameIcon *cell = (CellRendererFrameIcon*)object; - - GdkPixbuf *pixbufs[] = { cell->pixbuf_active, cell->pixbuf_highlighted }; + GdkPixbuf *pixbufs[2]; int i; + + pixbufs[0] = cell->pixbuf_active; + pixbufs[1] = cell->pixbuf_highlighted; + for(i = 0; i < 2; i++) { if (pixbufs[i]) @@ -349,7 +352,7 @@ GType cell_renderer_frame_icon_get_type(void) /* * creates new renderer */ -GtkCellRenderer* cell_renderer_frame_icon_new() +GtkCellRenderer* cell_renderer_frame_icon_new(void) { return g_object_new(TYPE_CELL_RENDERER_FRAME_ICON, NULL); } Modified: debugger/src/cell_renderers/cellrenderertoggle.c 2 files changed, 1 insertions(+), 1 deletions(-) =================================================================== @@ -100,7 +100,7 @@ GType cell_renderer_toggle_get_type(void) /* * creates new renderer */ -GtkCellRenderer* cell_renderer_toggle_new() +GtkCellRenderer* cell_renderer_toggle_new(void) { return g_object_new(TYPE_CELL_RENDERER_TOGGLE, NULL); } Modified: debugger/src/dbm_gdb.c 372 files changed, 203 insertions(+), 169 deletions(-) =================================================================== @@ -122,16 +122,16 @@ enum sr { static int active_frame = 0; /* forward declarations */ -void stop(); -variable* add_watch(gchar* expression); -void update_watches(); -void update_autos(); -void update_files(); +static void stop(void); +static variable* add_watch(gchar* expression); +static void update_watches(void); +static void update_autos(void); +static void update_files(void); /* * print message using color, based on message type */ -void colorize_message(gchar *message) +static void colorize_message(gchar *message) { const gchar *color; if ('=' == *message) @@ -200,7 +200,7 @@ static void on_gdb_exit(GPid pid, gint status, gpointer data) /* * reads gdb_out until "(gdb)" prompt met */ -static GList* read_until_prompt() +static GList* read_until_prompt(void) { GList *lines = NULL; @@ -221,7 +221,7 @@ static GList* read_until_prompt() /* * write a command to a gdb channel and flush with a newlinw character */ -void gdb_input_write_line(const gchar *line) +static void gdb_input_write_line(const gchar *line) { GIOStatus st; GError *err = NULL; @@ -302,7 +302,7 @@ static GList* add_to_queue(GList* queue, const gchar *message, const gchar *comm * reads from startup async commands. * looks for a command completion (normal or abnormal), if noraml - executes next command */ -void exec_async_command(const gchar* command); +static void exec_async_command(const gchar* command); static gboolean on_read_async_output(GIOChannel * src, GIOCondition cond, gpointer data) { gchar *line; @@ -317,13 +317,17 @@ static gboolean on_read_async_output(GIOChannel * src, GIOCondition cond, gpoint { /* got some result */ + GList *lines; + GList *commands = (GList*)data; + gchar *coma; + g_source_remove(gdb_id_out); - GList *lines = read_until_prompt(); + lines = read_until_prompt(); g_list_foreach(lines, (GFunc)g_free, NULL); g_list_free (lines); - gchar* coma = strchr(line, ','); + coma = strchr(line, ','); if (coma) { *coma = '\0'; @@ -332,16 +336,16 @@ static gboolean on_read_async_output(GIOChannel * src, GIOCondition cond, gpoint else coma = line + strlen(line); - GList *commands = (GList*)data; - if (!strcmp(line, "^done")) { /* command completed succesfully - run next command if exists */ if (commands->next) { /* if there are commads left */ + queue_item *item; + commands = commands->next; - queue_item *item = (queue_item*)commands->data; + item = (queue_item*)commands->data; /* send message to debugger messages window */ if (item->message) @@ -406,16 +410,17 @@ static gboolean on_read_async_output(GIOChannel * src, GIOCondition cond, gpoint * asyncronous gdb output reader * looks for a stopped event, then notifies "debug" module and removes async handler */ -enum dbs debug_get_state(); +enum dbs debug_get_state(void); static gboolean on_read_from_gdb(GIOChannel * src, GIOCondition cond, gpointer data) { gchar *line; gsize length; + gboolean prompt; if (G_IO_STATUS_NORMAL != g_io_channel_read_line(src, &line, NULL, &length, NULL)) return TRUE; - gboolean prompt = !strcmp(line, GDB_PROMPT); + prompt = !strcmp(line, GDB_PROMPT); *(line + length) = '\0'; @@ -440,14 +445,18 @@ static gboolean on_read_from_gdb(GIOChannel * src, GIOCondition cond, gpointer d } else if (g_str_has_prefix(line, "=thread-created")) { + int thread_id; + *(strrchr(line, ',') - 1) = '\0'; - int thread_id = atoi(line + strlen("=thread-created,id=\"")); + thread_id = atoi(line + strlen("=thread-created,id=\"")); dbg_cbs->add_thread(thread_id); } else if (g_str_has_prefix(line, "=thread-exited")) { + int thread_id; + *(strrchr(line, ',') - 1) = '\0'; - int thread_id = atoi(line + strlen("=thread-exited,id=\"")); + thread_id = atoi(line + strlen("=thread-exited,id=\"")); dbg_cbs->remove_thread(thread_id); } else if (g_str_has_prefix(line, "=library-loaded") || g_str_has_prefix(line, "=library-unloaded")) @@ -470,14 +479,17 @@ static gboolean on_read_from_gdb(GIOChannel * src, GIOCondition cond, gpointer d dbg_cbs->set_run(); else if (!strcmp(line, "*stopped")) { + char *reason; + /* removing read callback (will pulling all output left manually) */ g_source_remove(gdb_id_out); /* looking for a reason to stop */ - char *next = NULL; - char *reason = strstr(record, "reason=\""); + reason = strstr(record, "reason=\""); if (reason) { + char *next; + reason += strlen("reason=\""); next = strstr(reason, "\"") + 1; *(next - 1) = '\0'; @@ -538,9 +550,12 @@ static gboolean on_read_from_gdb(GIOChannel * src, GIOCondition cond, gpointer d { if (stop_reason == SR_EXITED_WITH_CODE) { - gchar *code = strstr(reason + strlen(reason) + 1,"exit-code=\"") + strlen("exit-code=\""); + gchar *code; + gchar *message; + + code = strstr(reason + strlen(reason) + 1,"exit-code=\"") + strlen("exit-code=\""); *(strchr(code, '\"')) = '\0'; - gchar *message = g_strdup_printf(_("Program exited with code \"%i\""), (int)(char)strtol(code, NULL, 8)); + message = g_strdup_printf(_("Program exited with code \"%i\""), (int)(char)strtol(code, NULL, 8)); dbg_cbs->report_error(message); g_free(message); @@ -552,6 +567,9 @@ static gboolean on_read_from_gdb(GIOChannel * src, GIOCondition cond, gpointer d } else if (g_str_has_prefix (line, "^error")) { + GList *lines, *iter; + char *msg; + /* removing read callback (will pulling all output left manually) */ g_source_remove(gdb_id_out); @@ -565,21 +583,18 @@ static gboolean on_read_from_gdb(GIOChannel * src, GIOCondition cond, gpointer d } /* get message */ - char *msg = strstr(line, "msg=\"") + strlen("msg=\""); + msg = strstr(line, "msg=\"") + strlen("msg=\""); *strrchr(msg, '\"') = '\0'; msg = g_strcompress(msg); /* reading until prompt */ - GList *lines = read_until_prompt(); - GList *iter = lines; - while(iter) + lines = read_until_prompt(); + for (iter = lines; iter; iter = iter->next) { gchar *l = (gchar*)iter->data; if (strcmp(l, GDB_PROMPT)) colorize_message(l); g_free(l); - - iter = iter->next; } g_list_free (lines); @@ -600,7 +615,7 @@ static gboolean on_read_from_gdb(GIOChannel * src, GIOCondition cond, gpointer d * connects reader to output channel and exits * after execution */ -void exec_async_command(const gchar* command) +static void exec_async_command(const gchar* command) { #ifdef DEBUG_OUTPUT dbg_cbs->send_message(command, "red"); @@ -617,8 +632,10 @@ void exec_async_command(const gchar* command) * i.e. reading output right * after execution */ -result_class exec_sync_command(const gchar* command, gboolean wait4prompt, gchar** command_record) +static result_class exec_sync_command(const gchar* command, gboolean wait4prompt, gchar** command_record) { + GList *lines, *iter; + result_class rc; #ifdef DEBUG_OUTPUT dbg_cbs->send_message(command, "red"); @@ -630,21 +647,18 @@ result_class exec_sync_command(const gchar* command, gboolean wait4prompt, gchar if (!wait4prompt) return RC_DONE; - GList *lines = read_until_prompt(); + lines = read_until_prompt(); #ifdef DEBUG_OUTPUT - GList *line = lines; - while (line) + for (iter = lines; iter; iter = iter->next) { - dbg_cbs->send_message((gchar*)line->data, "red"); - line = line->next; + dbg_cbs->send_message((gchar*)iter->data, "red"); } #endif - result_class rc = RC_ERROR; - GList *iter = lines; + rc = RC_ERROR; - while (iter) + for (iter = lines; iter; iter = iter->next) { gchar *line = (gchar*)iter->data; @@ -683,9 +697,7 @@ result_class exec_sync_command(const gchar* command, gboolean wait4prompt, gchar { colorize_message (line); } - - iter = iter->next; - } + } g_list_foreach(lines, (GFunc)g_free, NULL); g_list_free(lines); @@ -696,16 +708,21 @@ result_class exec_sync_command(const gchar* command, gboolean wait4prompt, gchar /* * starts gdb, collects commands and start the first one */ -gboolean run(const gchar* file, const gchar* commandline, GList* env, GList *witer, GList *biter, const gchar* terminal_device, dbg_callbacks* callbacks) +static gboolean run(const gchar* file, const gchar* commandline, GList* env, GList *witer, GList *biter, const gchar* terminal_device, dbg_callbacks* callbacks) { GError *err = NULL; + const gchar *exclude[] = { "LANG", NULL }; + gchar **gdb_env = utils_copy_environment(exclude, "LANG", "C", NULL); + gchar *working_directory = g_path_get_dirname(file); + GList *lines, *iter; + GList *commands = NULL; + GString *command; + int bp_index; + queue_item *item; dbg_cbs = callbacks; /* spawn GDB */ - const gchar *exclude[] = { "LANG", NULL }; - gchar **gdb_env = utils_copy_environment(exclude, "LANG", "C", NULL); - gchar *working_directory = g_path_get_dirname(file); if (!g_spawn_async_with_pipes(working_directory, (gchar**)gdb_args, gdb_env, GDB_SPAWN_FLAGS, NULL, NULL, &gdb_pid, &gdb_in, &gdb_out, NULL, &err)) @@ -730,16 +747,14 @@ gboolean run(const gchar* file, const gchar* commandline, GList* env, GList *wit gdb_ch_out = g_io_channel_unix_new(gdb_out); /* reading starting gdb messages */ - GList *lines = read_until_prompt(); - GList *line = lines; - while (line) + lines = read_until_prompt(); + for (iter = lines; iter; iter = iter->next) { - gchar *unescaped = g_strcompress((gchar*)line->data); + gchar *unescaped = g_strcompress((gchar*)iter->data); if (strlen(unescaped)) { - colorize_message((gchar*)line->data); + colorize_message((gchar*)iter->data); } - line = line->next; } g_list_foreach(lines, (GFunc)g_free, NULL); g_list_free(lines); @@ -756,10 +771,9 @@ gboolean run(const gchar* file, const gchar* commandline, GList* env, GList *wit } /* collect commands */ - GList *commands = NULL; /* loading file */ - GString *command = g_string_new(""); + command = g_string_new(""); g_string_printf(command, "-file-exec-and-symbols \"%s\"", file); commands = add_to_queue(commands, _("~\"Loading target file.\\n\""), command->str, _("Error loading file"), FALSE); g_string_free(command, TRUE); @@ -786,14 +800,15 @@ gboolean run(const gchar* file, const gchar* commandline, GList* env, GList *wit g_string_free(command, TRUE); /* set passed evironment */ - GList *iter = env; + iter = env; while (iter) { - gchar *name = (gchar*)iter->data; + gchar *name, *value; + + name = (gchar*)iter->data; iter = iter->next; - - gchar *value = (gchar*)iter->data; - + value = (gchar*)iter->data; + command = g_string_new(""); g_string_printf(command, "-gdb-set environment %s=%s", name, value); @@ -804,14 +819,15 @@ gboolean run(const gchar* file, const gchar* commandline, GList* env, GList *wit } /* set breaks */ - int bp_index = 1; + bp_index = 1; while (biter) { breakpoint *bp = (breakpoint*)biter->data; + GString *error_message = g_string_new(""); + command = g_string_new(""); g_string_printf(command, "-break-insert -f \"\\\"%s\\\":%i\"", bp->file, bp->line); - GString *error_message = g_string_new(""); g_string_printf(error_message, _("Breakpoint at %s:%i cannot be set\nDebugger message: %s"), bp->file, bp->line, "%s"); commands = add_to_queue(commands, NULL, command->str, error_message->str, TRUE); @@ -855,7 +871,7 @@ gboolean run(const gchar* file, const gchar* commandline, GList* env, GList *wit /* connect read callback to the output chanel */ gdb_id_out = g_io_add_watch(gdb_ch_out, G_IO_IN, on_read_async_output, commands); - queue_item *item = (queue_item*)commands->data; + item = (queue_item*)commands->data; /* send message to debugger messages window */ if (item->message) @@ -872,7 +888,7 @@ gboolean run(const gchar* file, const gchar* commandline, GList* env, GList *wit /* * starts debugging */ -void restart(char* terminal_device) +static void restart(void) { dbg_cbs->clear_messages(); exec_async_command("-exec-run &"); @@ -881,7 +897,7 @@ void restart(char* terminal_device) /* * stops GDB */ -void stop() +static void stop(void) { exec_sync_command("-gdb-exit", FALSE, NULL); } @@ -889,7 +905,7 @@ void stop() /* * resumes GDB */ -void resume() +static void resume(void) { exec_async_command("-exec-continue"); } @@ -897,7 +913,7 @@ void resume() /* * step over */ -void step_over() +static void step_over(void) { exec_async_command("-exec-next"); } @@ -905,7 +921,7 @@ void step_over() /* * step into */ -void step_into() +static void step_into(void) { exec_async_command("-exec-step"); } @@ -913,7 +929,7 @@ void step_into() /* * step out */ -void step_out() +static void step_out(void) { exec_async_command("-exec-finish"); } @@ -921,7 +937,7 @@ void step_out() /* * execute until */ -void execute_until(const gchar *file, int line) +static void execute_until(const gchar *file, int line) { gchar command[1000]; sprintf(command, "-exec-until %s:%i", file, line); @@ -931,29 +947,34 @@ void execute_until(const gchar *file, int line) /* * gets breakpoint number by file and line */ -int get_break_number(char* file, int line) +static int get_break_number(char* file, int line) { - gchar* record; + gchar *record, *bstart; + exec_sync_command("-break-list", TRUE, &record); - - gchar* bstart = record; + bstart = record; + while ( (bstart = strstr(bstart, "bkpt=")) ) { + gchar *fname, *file_quoted; + int num, bline; + gboolean break_found; + bstart += strlen("bkpt={number=\""); *strchr(bstart, '\"') = '\0'; - int num = atoi(bstart); + num = atoi(bstart); bstart += strlen(bstart) + 1; bstart = strstr(bstart, "original-location=\"") + strlen("original-location=\""); *strchr(bstart, ':') = '\0'; - gchar *fname = bstart; + fname = bstart; bstart += strlen(bstart) + 1; *strchr(bstart, '\"') = '\0'; - int bline = atoi(bstart); + bline = atoi(bstart); - gchar *file_quoted = g_strdup_printf("\\\"%s\\\"", file); - int break_found = !strcmp(fname, file_quoted) && bline == line; + file_quoted = g_strdup_printf("\\\"%s\\\"", file); + break_found = !strcmp(fname, file_quoted) && bline == line; g_free(file_quoted); if (break_found) @@ -972,14 +993,17 @@ int get_break_number(char* file, int line) /* * set breakpoint */ -gboolean set_break(breakpoint* bp, break_set_activity bsa) +static gboolean set_break(breakpoint* bp, break_set_activity bsa) { char command[1000]; if (BSA_NEW_BREAK == bsa) { /* new breakpoint */ + + char *pos; + int number; gchar *record = NULL; - + /* 1. insert breakpoint */ sprintf (command, "-break-insert \"\\\"%s\\\":%i\"", bp->file, bp->line); if (RC_DONE != exec_sync_command(command, TRUE, &record)) @@ -993,9 +1017,9 @@ gboolean set_break(breakpoint* bp, break_set_activity bsa) } } /* lookup break-number */ - char *pos = strstr(record, "number=\"") + strlen("number=\""); + pos = strstr(record, "number=\"") + strlen("number=\""); *strchr(pos, '\"') = '\0'; - int number = atoi(pos); + number = atoi(pos); g_free(record); /* 2. set hits count if differs from 0 */ if (bp->hitscount) @@ -1042,15 +1066,17 @@ gboolean set_break(breakpoint* bp, break_set_activity bsa) /* * removes breakpoint */ -gboolean remove_break(breakpoint* bp) +static gboolean remove_break(breakpoint* bp) { /* find break number */ int number = get_break_number(bp->file, bp->line); if (-1 != number) { + result_class rc; gchar command[100]; + sprintf(command, "-break-delete %i", number); - result_class rc = exec_sync_command(command, TRUE, NULL); + rc = exec_sync_command(command, TRUE, NULL); return RC_DONE == rc; } @@ -1060,7 +1086,7 @@ gboolean remove_break(breakpoint* bp) /* * get active frame */ -int get_active_frame() +static int get_active_frame(void) { return active_frame; } @@ -1068,7 +1094,7 @@ int get_active_frame() /* * select frame */ -void set_active_frame(int frame_number) +static void set_active_frame(int frame_number) { gchar *command = g_strdup_printf("-stack-select-frame %i", frame_number); if (RC_DONE == exec_sync_command(command, TRUE, NULL)) @@ -1083,23 +1109,27 @@ void set_active_frame(int frame_number) /* * gets stack */ -GList* get_stack() +static GList* get_stack(void) { gchar* record = NULL; - result_class rc = exec_sync_command("-stack-list-frames", TRUE, &record); + GList *stack = NULL; + gchar **frames, **next; + result_class rc; + + rc = exec_sync_command("-stack-list-frames", TRUE, &record); if (RC_DONE != rc) return NULL; - - GList *stack = NULL; - gchar **frames = g_strsplit(record, "frame=", 0); - gchar **next = frames + 1; + frames = g_strsplit(record, "frame=", 0); + next = frames + 1; while (*next) { frame *f = frame_new(); + int line; + gchar *pos, *fullname, *file, *from; /* adresss */ - gchar* pos = strstr(*next, "addr=\"") + strlen("addr=\""); + pos = strstr(*next, "addr=\"") + strlen("addr=\""); *strchr(pos, '\"') = '\0'; f->address = g_strdup(pos); pos += strlen(pos) + 1; @@ -1111,9 +1141,9 @@ GList* get_stack() pos += strlen(pos) + 1; /* file: fullname | file | from */ - char* fullname = strstr(pos, "fullname=\""); - char* file = strstr(pos, "file=\""); - char* from = strstr(pos, "from=\""); + fullname = strstr(pos, "fullname=\""); + file = strstr(pos, "file=\""); + from = strstr(pos, "from=\""); if (fullname) { @@ -1148,7 +1178,7 @@ GList* get_stack() f->have_source = fullname ? TRUE : FALSE; /* line */ - int line = 0; + line = 0; pos = strstr(pos, "line=\""); if (pos) { @@ -1174,13 +1204,16 @@ GList* get_stack() * unescapes hex values (\0xXXX) to readable chars * converting it from wide character value to char */ -gchar* unescape_hex_values(gchar *src) +static gchar* unescape_hex_values(gchar *src) { GString *dest = g_string_new(""); gchar *slash; while ( (slash = strstr(src, "\\x")) ) { + char hex[4] = { 0, 0, 0, '\0' }; + wchar_t wc; + /* append what has been missed unescaping it in advance */ if (slash - src) @@ -1192,10 +1225,9 @@ gchar* unescape_hex_values(gchar *src) g_free(unescaped); } - char hex[4] = { 0, 0, 0, '\0' }; strncpy(hex, slash + 2, 3); - wchar_t wc = (wchar_t)strtol(hex, NULL, 16); - + wc = (wchar_t)strtol(hex, NULL, 16); + if (iswalpha(wc)) { gchar mb[5]; @@ -1223,7 +1255,7 @@ gchar* unescape_hex_values(gchar *src) * checks if pc pointer points to the * valid printable charater */ -gboolean isvalidcharacter(gchar *pc, gboolean utf8) +static gboolean isvalidcharacter(gchar *pc, gboolean utf8) { if (utf8) return -1 != g_utf8_get_char_validated(pc, -1); @@ -1234,7 +1266,7 @@ gboolean isvalidcharacter(gchar *pc, gboolean utf8) /* * unescapes string, handles octal characters representations */ -gchar* unescape_octal_values(gchar *text) +static gchar* unescape_octal_values(gchar *text) { GString *value = g_string_new(""); @@ -1285,7 +1317,7 @@ gchar* unescape_octal_values(gchar *text) /* * unescapes value string, handles hexidecimal and octal characters representations */ -gchar *unescape(gchar *text) +static gchar *unescape(gchar *text) { gchar *retval = NULL; @@ -1310,7 +1342,7 @@ gchar *unescape(gchar *text) /* * updates variables from vars list */ -void get_variables (GList *vars) +static void get_variables (GList *vars) { while (vars) { @@ -1321,13 +1353,16 @@ void get_variables (GList *vars) gchar *varname = var->internal->str; gchar *record = NULL; gchar *pos; + gchar *expression; + int numchild; + gchar *value; /* path expression */ sprintf(command, "-var-info-path-expression \"%s\"", varname); exec_sync_command(command, TRUE, &record); pos = strstr(record, "path_expr=\"") + strlen("path_expr=\""); *(strrchr(pos, '\"')) = '\0'; - gchar *expression = unescape(pos); + expression = unescape(pos); g_string_assign(var->expression, expression); g_free(expression); g_free(record); @@ -1337,7 +1372,7 @@ void get_variables (GList *vars) exec_sync_command(command, TRUE, &record); pos = strstr(record, "numchild=\"") + strlen("numchild=\""); *(strchr(pos, '\"')) = '\0'; - int numchild = atoi(pos); + numchild = atoi(pos); var->has_children = numchild > 0; g_free(record); @@ -1354,7 +1389,7 @@ void get_variables (GList *vars) } pos += + strlen("value=\""); *(strrchr(pos, '\"')) = '\0'; - gchar *value = unescape(pos); + value = unescape(pos); g_string_assign(var->value, value); g_free(value); g_free(record); @@ -1374,8 +1409,12 @@ void get_variables (GList *vars) /* * updates files list */ -void update_files() +static void update_files(void) { + GHashTable *ht = g_hash_table_new_full(g_str_hash, g_str_equal, NULL, NULL); + gchar *record = NULL; + gchar *pos; + if (files) { /* free previous list */ @@ -1384,11 +1423,8 @@ void update_files() files = NULL; } - GHashTable *ht = g_hash_table_new_full(g_str_hash, g_str_equal, NULL, NULL); - - gchar *record = NULL; exec_sync_command("-file-list-exec-source-files", TRUE, &record); - gchar *pos = record; + pos = record; while ( (pos = strstr(pos, "fullname=\"")) ) { pos += strlen("fullname=\""); @@ -1409,13 +1445,14 @@ void update_files() /* * updates watches list */ -void update_watches() +static void update_watches(void) { gchar command[1000]; + GList *updating = NULL; + GList *iter; /* delete all GDB variables */ - GList *iter = watches; - while (iter) + for (iter = watches; iter; iter = iter->next) { variable *var = (variable*)iter->data; @@ -1427,22 +1464,19 @@ void update_watches() /* reset all variables fields */ variable_reset(var); - - iter = iter->next; } /* create GDB variables, adding successfully created variables to the list then passed for updatind */ - GList *updating = NULL; - iter = watches; - while (iter) + for (iter = watches; iter; iter = iter->next) { variable *var = (variable*)iter->data; - - /* try to create variable */ - gchar *record = NULL; + gchar *record = NULL; + gchar *pos; + gchar *escaped; - gchar *escaped = g_strescape(var->name->str, NULL); + /* try to create variable */ + escaped = g_strescape(var->name->str, NULL); sprintf(command, "-var-create - * \"%s\"", escaped); g_free(escaped); @@ -1451,14 +1485,13 @@ void update_watches() /* do not include to updating list, move to next watch */ var->evaluated = FALSE; g_string_assign(var->internal, ""); - g_free(record); - iter = iter->next; + g_free(record); continue; } /* find and assign internal name */ - gchar *pos = strstr(record, "name=\"") + strlen("name=\""); + pos = strstr(record, "name=\"") + strlen("name=\""); *strchr(pos, '\"') = '\0'; g_string_assign(var->internal, pos); g_free(record); @@ -1467,8 +1500,6 @@ void update_watches() /* add to updating list */ updating = g_list_append(updating, var); - - iter = iter->next; } /* update watches */ @@ -1481,20 +1512,20 @@ void update_watches() /* * updates autos list */ -void update_autos() +static void update_autos(void) { gchar command[1000]; + GList *unevaluated = NULL, *iter; + const char *gdb_commands[2]; + int i; /* remove all previous GDB variables for autos */ - GList *iter = autos; - while (iter) + for (iter = autos; iter; iter = iter->next) { variable *var = (variable*)iter->data; sprintf(command, "-var-delete %s", var->internal->str); exec_sync_command(command, TRUE, NULL); - - iter = iter->next; } g_list_foreach(autos, (GFunc)variable_free, NULL); @@ -1502,29 +1533,30 @@ void update_autos() autos = NULL; /* add current autos to the list */ - GList *unevaluated = NULL; - const char *gdb_commands[] = { g_strdup_printf("-stack-list-arguments 0 %i %i", active_frame, active_frame), "-stack-list-locals 0" }; - int i, size = sizeof (gdb_commands) / sizeof(char*); - for (i = 0; i < size; i++) + gdb_commands[0] = g_strdup_printf("-stack-list-arguments 0 %i %i", active_frame, active_frame); + gdb_commands[1] = "-stack-list-locals 0"; + for (i = 0; i < sizeof (gdb_commands) / sizeof(*gdb_commands); i++) { - gchar *record = NULL; + gchar *record = NULL, *pos; + result_class rc = exec_sync_command(gdb_commands[i], TRUE, &record); if (RC_DONE != rc) break; - gchar *pos = record; + pos = record; while ((pos = strstr(pos, "name=\""))) { + variable *var; + gchar *create_record = NULL, *escaped; + pos += strlen("name=\""); *(strchr(pos, '\"')) = '\0'; - variable *var = variable_new(pos, i ? VT_LOCAL : VT_ARGUMENT); + var = variable_new(pos, i ? VT_LOCAL : VT_ARGUMENT); /* create new gdb variable */ - gchar *create_record = NULL; - - gchar *escaped = g_strescape(pos, NULL); + escaped = g_strescape(pos, NULL); sprintf(command, "-var-create - * \"%s\"", escaped); g_free(escaped); @@ -1562,7 +1594,7 @@ void update_autos() /* * get autos list */ -GList* get_autos () +static GList* get_autos (void) { return g_list_copy(autos); } @@ -1570,7 +1602,7 @@ GList* get_autos () /* * get watches list */ -GList* get_watches () +static GList* get_watches (void) { return g_list_copy(watches); } @@ -1578,7 +1610,7 @@ GList* get_watches () /* * get files list */ -GList* get_files () +static GList* get_files (void) { return g_list_copy(files); } @@ -1586,7 +1618,7 @@ GList* get_files () /* * get list of children */ -GList* get_children (gchar* path) +static GList* get_children (gchar* path) { GList *children = NULL; @@ -1594,6 +1626,7 @@ GList* get_children (gchar* path) result_class rc; gchar *record = NULL; gchar *pos = NULL; + int numchild; /* children number */ sprintf(command, "-var-info-num-children \"%s\"", path); @@ -1602,7 +1635,7 @@ GList* get_children (gchar* path) return NULL; pos = strstr(record, "numchild=\"") + strlen("numchild=\""); *(strchr(pos, '\"')) = '\0'; - int numchild = atoi(pos); + numchild = atoi(pos); g_free(record); if (!numchild) return NULL; @@ -1616,6 +1649,7 @@ GList* get_children (gchar* path) while ( (pos = strstr(pos, "child={")) ) { gchar *name, *internal; + variable *var; /* name */ pos = strstr(pos, "name=\"") + strlen("name=\""); @@ -1629,12 +1663,12 @@ GList* get_children (gchar* path) name = g_strcompress(pos); - variable *var = variable_new2(name, internal, VT_CHILD); + var = variable_new2(name, internal, VT_CHILD); var->evaluated = TRUE; pos += strlen(pos) + 1; - children = g_list_prepend(children, var); + children = g_list_append(children, var); g_free(name); } @@ -1649,17 +1683,17 @@ GList* get_children (gchar* path) /* * add new watch */ -variable* add_watch(gchar* expression) +static variable* add_watch(gchar* expression) { gchar command[1000]; - + gchar *record = NULL, *escaped, *pos; + GList *vars = NULL; variable *var = variable_new(expression, VT_WATCH); + watches = g_list_append(watches, var); /* try to create a variable */ - gchar *record = NULL; - - gchar *escaped = g_strescape(expression, NULL); + escaped = g_strescape(expression, NULL); sprintf(command, "-var-create - * \"%s\"", escaped); g_free(escaped); @@ -1669,12 +1703,12 @@ variable* add_watch(gchar* expression) return var; } - gchar *pos = strstr(record, "name=\"") + strlen("name=\""); + pos = strstr(record, "name=\"") + strlen("name=\""); *strchr(pos, '\"') = '\0'; g_string_assign(var->internal, pos); var->evaluated = TRUE; - GList *vars = g_list_append(NULL, var); + vars = g_list_append(NULL, var); get_variables(vars); g_free(record); @@ -1686,7 +1720,7 @@ variable* add_watch(gchar* expression) /* * remove watch */ -void remove_watch(gchar* internal) +static void remove_watch(gchar* internal) { GList *iter = watches; while (iter) @@ -1707,13 +1741,14 @@ void remove_watch(gchar* internal) /* * evaluates given expression and returns the result */ -gchar *evaluate_expression(gchar *expression) +static gchar *evaluate_expression(gchar *expression) { - gchar *record = NULL; - + gchar *record = NULL, *pos; char command[1000]; + result_class rc; + sprintf (command, "-data-evaluate-expression \"%s\"", expression); - result_class rc = exec_sync_command(command, TRUE, &record); + rc = exec_sync_command(command, TRUE, &record); if (RC_DONE != rc) { @@ -1721,17 +1756,16 @@ gchar *evaluate_expression(gchar *expression) return NULL; } - gchar *pos = strstr(record, "value=\"") + strlen("value=\""); + pos = strstr(record, "value=\"") + strlen("value=\""); *(strrchr(pos, '\"')) = '\0'; - gchar *retval = unescape(pos); - - return retval; + + return unescape(pos); } /* * request GDB interrupt */ -gboolean request_interrupt() +static gboolean request_interrupt(void) { #ifdef DEBUG_OUTPUT char msg[1000]; @@ -1748,7 +1782,7 @@ gboolean request_interrupt() /* * get GDB error messages */ -gchar* error_message() +static gchar* error_message(void) { return err_message; } Modified: debugger/src/dconfig.c 146 files changed, 77 insertions(+), 69 deletions(-) =================================================================== @@ -79,20 +79,16 @@ /* * creates a copy of a specified keyfile */ -GKeyFile *create_copy_keyfile(GKeyFile *keyfile) +static GKeyFile *create_copy_keyfile(GKeyFile *keyfile) { - gchar *path; - close(g_file_open_tmp(NULL, &path, NULL)); - - gchar *config_data = g_key_file_to_data(keyfile, NULL, NULL); - g_file_set_contents(path, config_data, -1, NULL); - g_free(config_data); - - GKeyFile *copy = g_key_file_new(); - g_key_file_load_from_file(copy, path, G_KEY_FILE_NONE, NULL); + GKeyFile *copy; + gchar *data; + gsize length; - g_remove(path); - g_free(path); + data = g_key_file_to_data(keyfile, &length, NULL); + copy = g_key_file_new(); + g_key_file_load_from_data(copy, data, length, G_KEY_FILE_NONE, NULL); + g_free(data); return copy; } @@ -100,11 +96,13 @@ GKeyFile *create_copy_keyfile(GKeyFile *keyfile) /* * loads debug session from a keyfile and updates GUI */ -void debug_load_from_keyfile(GKeyFile *keyfile) +static void debug_load_from_keyfile(GKeyFile *keyfile) { + gchar *value; + int i, count; + debug_config_loading = TRUE; - gchar *value; /* target */ tpage_set_target(value = g_key_file_get_string(keyfile, DEBUGGER_GROUP, "target", NULL)); g_free(value); @@ -115,16 +113,14 @@ void debug_load_from_keyfile(GKeyFile *keyfile) tpage_set_commandline(value = g_key_file_get_string(keyfile, DEBUGGER_GROUP, "arguments", NULL)); g_free(value); - int i; - /* environment */ - int envcount = g_key_file_get_integer(keyfile, DEBUGGER_GROUP, "envvar_count", NULL); - for (i = 0; i < envcount; i++) + count = g_key_file_get_integer(keyfile, DEBUGGER_GROUP, "envvar_count", NULL); + for (i = 0; i < count; i++) { gchar *env_name_id = g_strdup_printf("envvar_%i_name", i); gchar *env_value_id = g_strdup_printf("envvar_%i_value", i); - gchar *name = g_key_file_get_string(keyfile, DEBUGGER_GROUP, env_name_id, NULL); + value = g_key_file_get_string(keyfile, DEBUGGER_GROUP, env_value_id, NULL); tpage_add_environment(name, value); @@ -137,8 +133,8 @@ void debug_load_from_keyfile(GKeyFile *keyfile) } /* watches */ - int wcount = g_key_file_get_integer(keyfile, DEBUGGER_GROUP, "watches_count", NULL); - for (i = 0; i < wcount; i++) + count = g_key_file_get_integer(keyfile, DEBUGGER_GROUP, "watches_count", NULL); + for (i = 0; i < count; i++) { gchar *watch_id = g_strdup_printf("watch_%i", i); wtree_add_watch(value = g_key_file_get_string(keyfile, DEBUGGER_GROUP, watch_id, NULL)); @@ -147,8 +143,8 @@ void debug_load_from_keyfile(GKeyFile *keyfile) } /* breakpoints */ - int bcount = g_key_file_get_integer(keyfile, DEBUGGER_GROUP, "breaks_count", NULL); - for (i = 0; i < bcount; i++) + count = g_key_file_get_integer(keyfile, DEBUGGER_GROUP, "breaks_count", NULL); + for (i = 0; i < count; i++) { gchar *break_file_id = g_strdup_printf("break_%i_file", i); gchar *break_line_id = g_strdup_printf("break_%i_line", i); @@ -181,8 +177,11 @@ void debug_load_from_keyfile(GKeyFile *keyfile) /* * saves debug session to a keyfile using values from GUI */ -void save_to_keyfile(GKeyFile *keyfile) +static void save_to_keyfile(GKeyFile *keyfile) { + GList *_env, *watches, *_breaks, *iter; + int env_index, watch_index, bp_index; + g_key_file_remove_group(keyfile, DEBUGGER_GROUP, NULL); g_key_file_set_string(keyfile, DEBUGGER_GROUP, "target", tpage_get_target()); @@ -190,19 +189,20 @@ void save_to_keyfile(GKeyFile *keyfile) g_key_file_set_string(keyfile, DEBUGGER_GROUP, "arguments", tpage_get_commandline()); /* environment */ - GList *_env = tpage_get_environment(); + _env = tpage_get_environment(); g_key_file_set_integer(keyfile, DEBUGGER_GROUP, "envvar_count", g_list_length(_env) / 2); - GList *iter = _env; - int env_index = 0; + iter = _env; + env_index = 0; while(iter) { - gchar *name = (gchar*)iter->data; - iter = iter->next; - gchar *value = (gchar*)iter->data; - + gchar *name, *value; gchar *env_name_id = g_strdup_printf("envvar_%i_name", env_index); gchar *env_value_id = g_strdup_printf("envvar_%i_value", env_index); - + + name = (gchar*)iter->data; + iter = iter->next; + value = (gchar*)iter->data; + g_key_file_set_string(keyfile, DEBUGGER_GROUP, env_name_id, name); g_key_file_set_string(keyfile, DEBUGGER_GROUP, env_value_id, value); @@ -216,13 +216,12 @@ void save_to_keyfile(GKeyFile *keyfile) g_list_free(_env); /* watches */ - GList *watches = wtree_get_watches(); + watches = wtree_get_watches(); g_key_file_set_integer(keyfile, DEBUGGER_GROUP, "watches_count", g_list_length(watches)); - int watch_index = 0; - GList *biter = watches; - while (biter) + watch_index = 0; + for (iter = watches; iter; iter = iter->next) { - gchar *watch = (gchar*)biter->data; + gchar *watch = (gchar*)iter->data; gchar *watch_id = g_strdup_printf("watch_%i", watch_index); g_key_file_set_string(keyfile, DEBUGGER_GROUP, watch_id, watch); @@ -230,19 +229,17 @@ void save_to_keyfile(GKeyFile *keyfile) g_free(watch_id); watch_index++; - biter = biter->next; } g_list_foreach(watches, (GFunc)g_free, NULL); g_list_free(watches); /* breakpoints */ - GList *_breaks = breaks_get_all(); + _breaks = breaks_get_all(); g_key_file_set_integer(keyfile, DEBUGGER_GROUP, "breaks_count", g_list_length(_breaks)); - int bp_index = 0; - biter = _breaks; - while (biter) + bp_index = 0; + for (iter = _breaks; iter; iter = iter->next) { - breakpoint *bp = (breakpoint*)biter->data; + breakpoint *bp = (breakpoint*)iter->data; gchar *break_file_id = g_strdup_printf("break_%i_file", bp_index); gchar *break_line_id = g_strdup_printf("break_%i_line", bp_index); @@ -261,9 +258,8 @@ void save_to_keyfile(GKeyFile *keyfile) g_free(break_condition_id); g_free(break_hits_id); g_free(break_enabled_id); - + bp_index++; - biter = biter->next; } g_list_free(_breaks); } @@ -284,6 +280,8 @@ static gpointer saving_thread_func(gpointer data) (debug_config_changed && DEBUG_STORE_PLUGIN == dstore) ) { + gchar *config_data; + /* if all saving is going to be done to a plugin keyfile */ if (debug_config_changed) { @@ -291,7 +289,7 @@ static gpointer saving_thread_func(gpointer data) debug_config_changed = FALSE; } - gchar *config_data = g_key_file_to_data(keyfile_plugin, NULL, NULL); + config_data = g_key_file_to_data(keyfile_plugin, NULL, NULL); g_file_set_contents(plugin_config_path, config_data, -1, NULL); g_free(config_data); @@ -300,10 +298,12 @@ static gpointer saving_thread_func(gpointer data) if (debug_config_changed && DEBUG_STORE_PROJECT == dstore) { + gchar *config_data; + /* if debug is saved into a project and has been changed */ save_to_keyfile(keyfile_project); - gchar *config_data = g_key_file_to_data(keyfile_project, NULL, NULL); + config_data = g_key_file_to_data(keyfile_project, NULL, NULL); g_file_set_contents(geany_data->app->project->file_name, config_data, -1, NULL); g_free(config_data); @@ -324,7 +324,7 @@ static gpointer saving_thread_func(gpointer data) /* * set "debug changed" flag to save it on "saving_thread" thread */ -void config_set_debug_changed() +void config_set_debug_changed(void) { if (!debug_config_loading) { @@ -339,9 +339,10 @@ void config_set_debug_changed() */ void config_set_panel(int config_part, gpointer config_value, ...) { + va_list ap; + g_mutex_lock(change_config_mutex); - va_list ap; va_start(ap, config_value); while(config_part) @@ -402,7 +403,7 @@ void config_set_panel(int config_part, gpointer config_value, ...) /* * set default debug session values to a keyfile */ -void config_set_debug_defaults(GKeyFile *keyfile) +static void config_set_debug_defaults(GKeyFile *keyfile) { g_key_file_set_string(keyfile, DEBUGGER_GROUP, "target", ""); g_key_file_set_string(keyfile, DEBUGGER_GROUP, "debugger", ""); @@ -416,18 +417,20 @@ void config_set_debug_defaults(GKeyFile *keyfile) /* * set default panel config values in a GKeyFile */ -void config_set_panel_defaults(GKeyFile *keyfile) +static void config_set_panel_defaults(GKeyFile *keyfile) { - g_key_file_set_boolean(keyfile_plugin, "tabbed_mode", "enabled", FALSE); - int all_tabs[] = { TID_TARGET, TID_BREAKS, TID_AUTOS, TID_WATCH, TID_STACK, TID_TERMINAL, TID_MESSAGES }; + int left_tabs[] = { TID_TARGET, TID_BREAKS, TID_AUTOS, TID_WATCH }; + int right_tabs[] = { TID_STACK, TID_TERMINAL, TID_MESSAGES }; + + g_key_file_set_boolean(keyfile_plugin, "tabbed_mode", "enabled", FALSE); + /* all tabs */ g_key_file_set_integer_list(keyfile, "one_panel_mode", "tabs", all_tabs, sizeof(all_tabs) / sizeof(int)); g_key_file_set_integer(keyfile, "one_panel_mode", "selected_tab_index", 0); - - int left_tabs[] = { TID_TARGET, TID_BREAKS, TID_AUTOS, TID_WATCH }; + /* left tabs */ g_key_file_set_integer_list(keyfile, "two_panels_mode", "left_tabs", left_tabs, sizeof(left_tabs) / sizeof(int)); g_key_file_set_integer(keyfile, "two_panels_mode", "left_selected_tab_index", 0); - int right_tabs[] = { TID_STACK, TID_TERMINAL, TID_MESSAGES }; + /* right tabs */ g_key_file_set_integer_list(keyfile, "two_panels_mode", "right_tabs", right_tabs, sizeof(right_tabs) / sizeof(int)); g_key_file_set_integer(keyfile, "two_panels_mode", "right_selected_tab_index", 0); @@ -437,7 +440,7 @@ void config_set_panel_defaults(GKeyFile *keyfile) /* * initialize */ -void config_init() +void config_init(void) { /* read config */ gchar *config_dir = g_build_path(G_DIR_SEPARATOR_S, geany_data->app->configdir, "plugins", "debugger", NULL); @@ -449,8 +452,10 @@ void config_init() keyfile_plugin = g_key_file_new(); if (!g_key_file_load_from_file(keyfile_plugin, plugin_config_path, G_KEY_FILE_NONE, NULL)) { + gchar *data; + config_set_panel_defaults(keyfile_plugin); - gchar *data = g_key_file_to_data(keyfile_plugin, NULL, NULL); + data = g_key_file_to_data(keyfile_plugin, NULL, NULL); g_file_set_contents(plugin_config_path, data, -1, NULL); g_free(data); } @@ -463,7 +468,7 @@ void config_init() /* * destroy */ -void config_destroy() +void config_destroy(void) { g_cond_signal(cond); /* ??? g_thread_join(saving_thread); */ @@ -484,12 +489,12 @@ void config_destroy() * config parts getters */ /* saving option */ -gboolean config_get_save_to_project() +gboolean config_get_save_to_project(void) { return g_key_file_get_boolean(keyfile_plugin, "saving_settings", "save_to_project", NULL); } /* panel config */ -gboolean config_get_tabbed() +gboolean config_get_tabbed(void) { return g_key_file_get_boolean(keyfile_plugin, "tabbed_mode", "enabled", NULL); } @@ -497,7 +502,7 @@ int* config_get_tabs(gsize *length) { return g_key_file_get_integer_list(keyfile_plugin, "one_panel_mode", "tabs", length, NULL); } -int config_get_selected_tab_index() +int config_get_selected_tab_index(void) { return g_key_file_get_integer(keyfile_plugin, "one_panel_mode", "selected_tab_index", NULL); } @@ -505,7 +510,7 @@ int* config_get_left_tabs(gsize *length) { return g_key_file_get_integer_list(keyfile_plugin, "two_panels_mode", "left_tabs", length, NULL); } -int config_get_left_selected_tab_index() +int config_get_left_selected_tab_index(void) { return g_key_file_get_integer(keyfile_plugin, "two_panels_mode", "left_selected_tab_index", NULL); } @@ -513,7 +518,7 @@ int* config_get_right_tabs(gsize *length) { return g_key_file_get_integer_list(keyfile_plugin, "two_panels_mode", "right_tabs", length, NULL); } -int config_get_right_selected_tab_index() +int config_get_right_selected_tab_index(void) { return g_key_file_get_integer(keyfile_plugin, "two_panels_mode", "right_selected_tab_index", NULL); } @@ -524,20 +529,23 @@ int config_get_right_selected_tab_index() */ void config_set_debug_store(debug_store store) { + GKeyFile *keyfile; + dstore = store; tpage_clear(); wtree_remove_all(); breaks_remove_all(); - GKeyFile *keyfile = DEBUG_STORE_PROJECT == dstore ? keyfile_project : keyfile_plugin; - + keyfile = DEBUG_STORE_PROJECT == dstore ? keyfile_project : keyfile_plugin; if (!g_key_file_has_group(keyfile, DEBUGGER_GROUP)) { + gchar *data, *file; + config_set_debug_defaults(keyfile); - gchar *data = g_key_file_to_data(keyfile, NULL, NULL); + data = g_key_file_to_data(keyfile, NULL, NULL); - gchar *file = DEBUG_STORE_PROJECT == dstore ? geany_data->app->project->file_name : plugin_config_path; + file = DEBUG_STORE_PROJECT == dstore ? geany_data->app->project->file_name : plugin_config_path; g_file_set_contents(file, data, -1, NULL); g_free(data); @@ -549,7 +557,7 @@ void config_set_debug_store(debug_store store) /* * updates keyfile_project from a current geany project path */ -void config_update_project_keyfile() +void config_update_project_keyfile(void) { if (keyfile_project) { Modified: debugger/src/dconfig.h 25 files changed, 16 insertions(+), 9 deletions(-) =================================================================== @@ -19,7 +19,12 @@ * MA 02110-1301, USA. */ +#ifndef DCOFIG_H +#define DCOFIG_H + #include <stdarg.h> +#include <glib.h> +#include <gtk/gtk.h> /* panel config parts */ #define CP_TABBED_MODE 1 @@ -37,31 +42,33 @@ } debug_store; -void config_init(); -void config_destroy(); +void config_init(void); +void config_destroy(void); void config_set_panel(int config_part, gpointer config_value, ...); -gboolean config_get_save_to_project(); +gboolean config_get_save_to_project(void); -gboolean config_get_tabbed(); +gboolean config_get_tabbed(void); int* config_get_tabs(gsize *length); -int config_get_selected_tab_index(); +int config_get_selected_tab_index(void); int* config_get_left_tabs(gsize *length); -int config_get_left_selected_tab_index(); +int config_get_left_selected_tab_index(void); int* config_get_right_tabs(gsize *length); -int config_get_right_selected_tab_index(); +int config_get_right_selected_tab_index(void); -void config_set_debug_changed(); +void config_set_debug_changed(void); void config_set_debug_store(debug_store store); void config_on_project_open(GObject *obj, GKeyFile *config, gpointer user_data); void config_on_project_close(GObject *obj, gpointer user_data); void config_on_project_save(GObject *obj, GKeyFile *config, gpointer user_data); -void config_update_project_keyfile(); +void config_update_project_keyfile(void); GtkWidget *config_plugin_configure(GtkDialog *dialog); + +#endif /* guard */ Modified: debugger/src/debug.c 176 files changed, 102 insertions(+), 74 deletions(-) =================================================================== @@ -153,7 +153,7 @@ /* * remove stack margin markers */ - void remove_stack_markers() +static void remove_stack_markers(void) { int active_frame_index = active_module->get_active_frame(); @@ -182,7 +182,7 @@ /* * add stack margin markers */ -static void add_stack_markers() +static void add_stack_markers(void) { int active_frame_index = active_module->get_active_frame(); @@ -219,32 +219,36 @@ static void on_watch_changed(GtkCellRendererText *renderer, gchar *path, gchar * { /* get iterator to the changed row */ GtkTreeIter iter; + gchar *oldvalue; + gchar *internal = NULL; + GtkTreePath *empty_path; GtkTreePath *tree_path = gtk_tree_path_new_from_string (path); + gboolean is_empty_row; + gchar *striped; + gtk_tree_model_get_iter ( gtk_tree_view_get_model(GTK_TREE_VIEW(wtree)), &iter, tree_path); /* get oldvalue */ - gchar* oldvalue; gtk_tree_model_get ( wmodel, &iter, W_NAME, &oldvalue, - -1); - gchar *internal = NULL; - gtk_tree_model_get ( + -1); + gtk_tree_model_get ( wmodel, &iter, W_INTERNAL, &internal, -1); /* check if it is empty row */ - GtkTreePath *empty_path = wtree_empty_path(); - gboolean is_empty_row = !gtk_tree_path_compare (tree_path, empty_path); + empty_path = wtree_empty_path(); + is_empty_row = !gtk_tree_path_compare (tree_path, empty_path); gtk_tree_path_free(empty_path); - gchar *striped = g_strstrip(g_strdup(new_text)); + striped = g_strstrip(g_strdup(new_text)); if (!strlen(striped) && !is_empty_row && dialogs_show_question(_("Delete variable?"))) @@ -272,8 +276,10 @@ static void on_watch_changed(GtkCellRendererText *renderer, gchar *path, gchar * /* if debug is active - remove old watch and add new one */ if (DBS_STOPPED == debug_state) { + variable *newvar; + active_module->remove_watch(internal); - variable *newvar = active_module->add_watch(striped); + newvar = active_module->add_watch(striped); change_watch(GTK_TREE_VIEW(wtree), is_empty_row ? &newiter : &iter, newvar); } @@ -306,14 +312,16 @@ static void on_watch_dragged_callback(GtkWidget *wgt, GdkDragContext *context, i { /* string that is dragged */ gchar *expression = (gchar*)seldata->data; - - /* lookup for where the text has been dropped */ GtkTreePath *path = NULL; GtkTreeViewDropPosition pos; + GtkTreePath *empty_path; + GtkTreeIter newvar; + + /* lookup for where the text has been dropped */ gtk_tree_view_get_dest_row_at_pos(GTK_TREE_VIEW(wtree), x, y, &path, &pos); /* if dropped into last row - insert before it */ - GtkTreePath *empty_path = wtree_empty_path(); + empty_path = wtree_empty_path(); if (!gtk_tree_path_compare(empty_path, path)) pos = GTK_TREE_VIEW_DROP_BEFORE; gtk_tree_path_free(empty_path); @@ -327,7 +335,6 @@ static void on_watch_dragged_callback(GtkWidget *wgt, GdkDragContext *context, i } /* insert new row */ - GtkTreeIter newvar; if (path) { GtkTreeIter sibling; @@ -340,7 +347,9 @@ static void on_watch_dragged_callback(GtkWidget *wgt, GdkDragContext *context, i } else { - GtkTreeIter empty = wtree_empty_row(); + GtkTreeIter empty; + + wtree_empty_row(&empty); gtk_tree_store_insert_before(wstore, &newvar, NULL, &empty); } @@ -362,18 +371,21 @@ static void on_watch_dragged_callback(GtkWidget *wgt, GdkDragContext *context, i */ static gboolean on_watch_key_pressed_callback(GtkWidget *widget, GdkEvent *event, gpointer user_data) { + GtkTreeSelection *selection; + GList *rows; + GtkTreePath *empty_path; + /* handling only Delete button pressing * that means "delete selected rows" */ - int keyval = ((GdkEventKey*)event)->keyval; - if (keyval != GDK_Delete) + if (((GdkEventKey*)event)->keyval != GDK_Delete) return FALSE; /* get selected rows */ - GtkTreeSelection *selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(wtree)); - GList *rows = gtk_tree_selection_get_selected_rows(selection, &wmodel); + selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(wtree)); + rows = gtk_tree_selection_get_selected_rows(selection, &wmodel); /* empty row path */ - GtkTreePath *empty_path = wtree_empty_path(); + empty_path = wtree_empty_path(); /* check whether only empty row was selected */ if (1 != gtk_tree_selection_count_selected_rows(selection) || @@ -381,6 +393,7 @@ static gboolean on_watch_key_pressed_callback(GtkWidget *widget, GdkEvent *even { /* path reference to select after deleteing finishes */ GtkTreeRowReference *reference_to_select = NULL; + GtkTreePath *path_to_select; /* get references to the rows */ GList *references = NULL; @@ -411,6 +424,7 @@ static gboolean on_watch_key_pressed_callback(GtkWidget *widget, GdkEvent *even current reference was already deleted */ if (gtk_tree_row_reference_valid(reference)) { + GtkTreeIter titer; GtkTreePath *path = gtk_tree_row_reference_get_path(reference); if (!reference_to_select) @@ -428,7 +442,6 @@ static gboolean on_watch_key_pressed_callback(GtkWidget *widget, GdkEvent *even } /* get iterator */ - GtkTreeIter titer; gtk_tree_model_get_iter(wmodel, &titer, path); /* remove from the debug session, if it's active */ @@ -467,7 +480,7 @@ static gboolean on_watch_key_pressed_callback(GtkWidget *widget, GdkEvent *even /* set selection */ gtk_tree_selection_unselect_all(selection); - GtkTreePath *path_to_select = gtk_tree_row_reference_get_path(reference_to_select); + path_to_select = gtk_tree_row_reference_get_path(reference_to_select); gtk_tree_selection_select_path(selection, path_to_select); gtk_tree_view_scroll_to_cell(GTK_TREE_VIEW(widget), path_to_select, NULL, TRUE, 0.5, 0.5); gtk_tree_path_free(path_to_select); @@ -491,7 +504,7 @@ static gboolean on_watch_key_pressed_callback(GtkWidget *widget, GdkEvent *even /* * mouse button has been pressed while being in watch(autos) tree view */ -gboolean on_watch_button_pressed_callback(GtkWidget *treeview, GdkEventButton *event, gpointer userdata) +static gboolean on_watch_button_pressed_callback(GtkWidget *treeview, GdkEventButton *event, gpointer userdata) { if (event->type == GDK_2BUTTON_PRESS && event->button == 1) { @@ -500,19 +513,20 @@ gboolean on_watch_button_pressed_callback(GtkWidget *treeview, GdkEventButton *e GTK_TREE_VIEW(treeview), (int)event->x, (int)event->y, &path, NULL, NULL, NULL)) { + gchar *expression = NULL; GtkTreeIter iter; GtkTreeModel *model = gtk_tree_view_get_model(GTK_TREE_VIEW(treeview)); gtk_tree_model_get_iter (model, &iter, path); - gchar *expression = NULL; gtk_tree_model_get(model, &iter, W_EXPRESSION, &expression, -1); if (strlen(expression)) { - GtkTreeIter newvar; - GtkTreeIter empty = wtree_empty_row(); + GtkTreeIter newvar, empty; + + wtree_empty_row(&empty); gtk_tree_store_insert_before(wstore, &newvar, NULL, &empty); /* if debugger is active (in stopped condition) - add to run-time watch list @@ -556,8 +570,10 @@ static void on_watch_expanded_callback(GtkTreeView *tree, GtkTreeIter *iter, Gtk if (only_stub) { - /* if item has not been expanded before */ + GList *children; gchar *internal; + + /* if item has not been expanded before */ gtk_tree_model_get ( model, iter, @@ -565,7 +581,7 @@ static void on_watch_expanded_callback(GtkTreeView *tree, GtkTreeIter *iter, Gtk -1); /* get children list */ - GList *children = active_module->get_children(internal); + children = active_module->get_children(internal); /* remove stub and add children */ expand_stub(tree, iter, children); @@ -605,7 +621,7 @@ static void enable_sensitive_widgets(gboolean enable) /* * called from debug module when debugger is being run */ -static void on_debugger_run () +static void on_debugger_run (void) { /* update debug state */ debug_state = DBS_RUNNING; @@ -634,6 +650,8 @@ static void on_debugger_run () */ static void on_debugger_stopped (int thread_id) { + GList *iter, *files, *autos, *watches; + /* update debug state */ debug_state = DBS_STOPPED; @@ -671,18 +689,15 @@ static void on_debugger_stopped (int thread_id) /* get current stack trace and put in the tree view */ stack = active_module->get_stack(); - - GList *iter = stack; - while (iter) + for (iter = stack; iter; iter = iter->next) { frame *f = (frame*)iter->data; stree_add(f); - iter = g_list_next(iter); } stree_select_first_frame(TRUE); /* files */ - GList *files = active_module->get_files(); + files = active_module->get_files(); /* remove from list and make writable those files, that are not in the current list */ iter = read_only_pages; @@ -690,6 +705,8 @@ static void on_debugger_stopped (int thread_id) { if (!g_list_find_custom(files, iter->data, (GCompareFunc)g_strcmp0)) { + GList *next; + /* set document writable */ GeanyDocument *doc = document_find_by_real_path((const gchar*)iter->data); if (doc) @@ -698,7 +715,7 @@ static void on_debugger_stopped (int thread_id) /* free file name */ g_free(iter->data); /* save next item pointer */ - GList *next = iter->next; + next = iter->next; /* remove current item */ read_only_pages = g_list_delete_link(read_only_pages, iter); @@ -729,11 +746,11 @@ static void on_debugger_stopped (int thread_id) g_list_free(files); /* autos */ - GList *autos = active_module->get_autos(); + autos = active_module->get_autos(); update_variables(GTK_TREE_VIEW(atree), NULL, autos); /* watches */ - GList *watches = active_module->get_watches(); + watches = active_module->get_watches(); update_variables(GTK_TREE_VIEW(wtree), NULL, watches); if (stack) @@ -763,6 +780,10 @@ static void on_debugger_stopped (int thread_id) */ static void on_debugger_exited (int code) { + GtkTextIter start, end; + GtkTextBuffer *buffer; + GList *iter; + /* remove marker for current instruction if was set */ if (stack) { @@ -785,8 +806,7 @@ static void on_debugger_exited (int code) vte_terminal_reset(VTE_TERMINAL(terminal), TRUE, TRUE); /* clear debug messages window */ - GtkTextIter start, end; - GtkTextBuffer *buffer = gtk_text_view_get_buffer(GTK_TEXT_VIEW(debugger_messages_textview)); + buffer = gtk_text_view_get_buffer(GTK_TEXT_VIEW(debugger_messages_textview)); gtk_text_buffer_get_bounds(buffer, &start, &end); gtk_text_buffer_delete(buffer, &start, &end); @@ -798,8 +818,7 @@ static void on_debugger_exited (int code) bptree_set_readonly(FALSE); /* set files that was readonly during debug writable */ - GList *iter = read_only_pages; - while (iter) + for (iter = read_only_pages; iter; iter = iter->next) { GeanyDocument *doc = document_find_by_real_path((const gchar*)iter->data); if (doc) @@ -807,8 +826,6 @@ static void on_debugger_exited (int code) /* free file name */ g_free(iter->data); - - iter = iter->next; } g_list_free(read_only_pages); read_only_pages = NULL; @@ -830,7 +847,7 @@ static void on_debugger_exited (int code) /* * called from debugger module to show a message in debugger messages pane */ -void on_debugger_message (const gchar* message, const gchar *color) +static void on_debugger_message (const gchar* message, const gchar *color) { gchar *msg = g_strdup_printf("%s\n", message); @@ -848,7 +865,7 @@ void on_debugger_message (const gchar* message, const gchar *color) /* * called from debugger module to clear messages tab */ -static void on_debugger_messages_clear () +static void on_debugger_messages_clear (void) { /* clear debug messages window */ GtkTextIter start, end; @@ -902,6 +919,7 @@ static void on_thread_added (int thread_id) */ static void on_select_frame(int frame_number) { + GList *autos, *watches; frame *f = (frame*)g_list_nth(stack, active_module->get_active_frame())->data; markers_remove_current_instruction(f->file, f->line); markers_add_frame(f->file, f->line); @@ -912,11 +930,11 @@ static void on_select_frame(int frame_number) g_hash_table_remove_all(calltips); /* autos */ - GList *autos = active_module->get_autos(); + autos = active_module->get_autos(); update_variables(GTK_TREE_VIEW(atree), NULL, autos); /* watches */ - GList *watches = active_module->get_watches(); + watches = active_module->get_watches(); update_variables(GTK_TREE_VIEW(wtree), NULL, watches); f = (frame*)g_list_nth(stack, frame_number)->data; @@ -928,8 +946,15 @@ static void on_select_frame(int frame_number) * init debug related GUI (watch tree view) * arguments: */ -void debug_init() +void debug_init(void) { + GtkWidget *scrollbar; + GtkWidget *hbox; + GKeyFile *config; + gchar *configfile; + gchar *font; + GtkTextBuffer *buffer; + /* create watch page */ wtree = wtree_init(on_watch_expanded_callback, on_watch_dragged_callback, @@ -979,11 +1004,11 @@ void debug_init() grantpt(pty_master); unlockpt(pty_master); vte_terminal_set_pty(VTE_TERMINAL(terminal), pty_master); - GtkWidget *scrollbar = gtk_vscrollbar_new(GTK_ADJUSTMENT(VTE_TERMINAL(terminal)->adjustment)); + scrollbar = gtk_vscrollbar_new(GTK_ADJUSTMENT(VTE_TERMINAL(terminal)->adjustment)); GTK_WIDGET_UNSET_FLAGS(scrollbar, GTK_CAN_FOCUS); tab_terminal = gtk_frame_new(NULL); gtk_frame_set_shadow_type (GTK_FRAME(tab_terminal), GTK_SHADOW_NONE); - GtkWidget *hbox = gtk_hbox_new(FALSE, 0); + hbox = gtk_hbox_new(FALSE, 0); gtk_container_add(GTK_CONTAINER(tab_terminal), hbox); gtk_box_pack_start(GTK_BOX(hbox), terminal, TRUE, TRUE, 0); gtk_box_pack_start(GTK_BOX(hbox), scrollbar, FALSE, FALSE, 0); @@ -992,10 +1017,10 @@ void debug_init() gtk_widget_set_size_request(GTK_WIDGET(terminal), 10, 10); vte_terminal_set_size(VTE_TERMINAL(terminal), 30, 1); /* set terminal font. */ - GKeyFile *config = g_key_file_new(); - gchar *configfile = g_strconcat(geany_data->app->configdir, G_DIR_SEPARATOR_S, "geany.conf", NULL); + config = g_key_file_new(); + configfile = g_strconcat(geany_data->app->configdir, G_DIR_SEPARATOR_S, "geany.conf", NULL); g_key_file_load_from_file(config, configfile, G_KEY_FILE_NONE, NULL); - gchar *font = utils_get_setting_string(config, "VTE", "font", "Monospace 10"); + font = utils_get_setting_string(config, "VTE", "font", "Monospace 10"); vte_terminal_set_font_from_string (VTE_TERMINAL(terminal), font); /* debug messages page */ @@ -1011,7 +1036,7 @@ void debug_init() gtk_scrolled_window_add_with_viewport(GTK_SCROLLED_WINDOW(tab_messages), debugger_messages_textview); /* create tex tags */ - GtkTextBuffer *buffer = gtk_text_view_get_buffer(GTK_TEXT_VIEW(debugger_messages_textview)); + buffer = gtk_text_view_get_buffer(GTK_TEXT_VIEW(debugger_messages_textview)); gtk_text_buffer_create_tag(buffer, "black", "foreground", "#000000", NULL); gtk_text_buffer_create_tag(buffer, "grey", "foreground", "#AAAAAA", NULL); gtk_text_buffer_create_tag(buffer, "red", "foreground", "#FF0000", NULL); @@ -1025,7 +1050,7 @@ void debug_init() /* * called when plugin is being unloaded to remove current instruction marker */ -void debug_destroy() +void debug_destroy(void) { /* close PTY file descriptors */ close(pty_master); @@ -1046,7 +1071,7 @@ void debug_destroy() /* * gets current debug state */ -enum dbs debug_get_state() +enum dbs debug_get_state(void) { return debug_state; } @@ -1054,7 +1079,7 @@ enum dbs debug_get_state() /* * gets current stack frames lisy */ -GList* debug_get_stack() +GList* debug_get_stack(void) { return stack; } @@ -1080,7 +1105,7 @@ int debug_get_module_index(const gchar *modulename) /* * gets GList with all debug modules pointers */ -GList* debug_get_modules() +GList* debug_get_modules(void) { GList *mods = NULL; module_description *desc = modules; @@ -1096,7 +1121,7 @@ GList* debug_get_modules() /* * checks whether currently active debug module supports asyncronous breaks */ -gboolean debug_supports_async_breaks() +gboolean debug_supports_async_breaks(void) { return active_module->features & MF_ASYNC_BREAKS; } @@ -1104,20 +1129,23 @@ gboolean debug_supports_async_breaks() /* * starts or continues debug process */ -void debug_run() +void debug_run(void) { if (DBS_IDLE == debug_state) { - gchar *target = g_strstrip(tpage_get_target()); + gchar *target, *commandline; + GList *env, *watches, *breaks; + + target = g_strstrip(tpage_get_target()); if (!strlen(target)) { g_free(target); return; } - gchar *commandline = tpage_get_commandline(); - GList *env = tpage_get_environment(); - GList *watches = get_root_items(GTK_TREE_VIEW(wtree)); - GList *breaks = breaks_get_all(); + commandline = tpage_get_commandline(); + env = tpage_get_environment(); + watches = get_root_items(GTK_TREE_VIEW(wtree)); + breaks = breaks_get_all(); /* init selected debugger module */ active_module = modules[tpage_get_debug_module_index()].module; @@ -1157,7 +1185,7 @@ void debug_run() /* * restarts debug process */ -void debug_restart() +void debug_restart(void) { if (DBS_STOPPED == debug_state) { @@ -1171,7 +1199,7 @@ void debug_restart() /* * stops debug process */ -void debug_stop() +void debug_stop(void) { if (DBS_STOPPED == debug_state) { @@ -1190,7 +1218,7 @@ void debug_stop() /* * step over */ -void debug_step_over() +void debug_step_over(void) { if (DBS_STOPPED == debug_state) active_module->step_over(); @@ -1199,7 +1227@@ Diff output truncated at 100000 characters. @@ -------------- This E-Mail was brought to you by github_commit_mail.py (Source: TBD).
1
0
0
0
[geany/geany-plugins] e04842: Merging b4n/fixes/geanylua
by Frank Lanitz
16 Jun '12
16 Jun '12
Branch: refs/heads/master Author: Frank Lanitz <frank(a)frank.uvena.de> Committer: Frank Lanitz <frank(a)frank.uvena.de> Date: Sat, 16 Jun 2012 10:23:26 Commit: e0484277debf5d2c9f110040e1aeb0f81579b12c
https://github.com/geany/geany-plugins/commit/e0484277debf5d2c9f110040e1aeb…
Log Message: ----------- Merging b4n/fixes/geanylua A couple of fixes for GeanyLUA Modified Paths: -------------- geanylua/glspi.h geanylua/glspi_app.c geanylua/glspi_init.c geanylua/glspi_keycmd.h geanylua/glspi_run.c geanylua/glspi_sci.c geanylua/glspi_sci.h geanylua/gsdlg_lua.c Modified: geanylua/glspi.h 6 files changed, 3 insertions(+), 3 deletions(-) =================================================================== @@ -95,7 +95,7 @@ #ifdef NEED_FAIL_ARG_TYPE /* Pushes an error message onto Lua stack if script passes a wrong arg type */ -static gint glspi_fail_arg_type(lua_State *L, const gchar *func, gint argnum, gchar *type) +static gint glspi_fail_arg_type(lua_State *L, const gchar *func, gint argnum, const gchar *type) { lua_pushfstring(L, _("Error in module \"%s\" at function %s():\n" " expected type \"%s\" for argument #%d\n"), @@ -109,7 +109,7 @@ static gint glspi_fail_arg_type(lua_State *L, const gchar *func, gint argnum, gc #ifdef NEED_FAIL_ARG_TYPES /* Same as above, but for two overloaded types, eg "string" OR "number" */ static gint glspi_fail_arg_types( - lua_State *L, const gchar *func, gint argnum, gchar *type1, gchar *type2) + lua_State *L, const gchar *func, gint argnum, const gchar *type1, const gchar *type2) { lua_pushfstring(L, _("Error in module \"%s\" at function %s():\n" " expected type \"%s\" or \"%s\" for argument #%d\n"), @@ -123,7 +123,7 @@ static gint glspi_fail_arg_types( #ifdef NEED_FAIL_ELEM_TYPE /*Pushes an error message onto Lua stack if table contains wrong element type*/ static gint glspi_fail_elem_type( - lua_State *L, const gchar *func, gint argnum, gint idx, gchar *type) + lua_State *L, const gchar *func, gint argnum, gint idx, const gchar *type) { lua_pushfstring(L, _("Error in module \"%s\" at function %s():\n" " invalid table in argument #%d:\n" Modified: geanylua/glspi_app.c 13 files changed, 7 insertions(+), 6 deletions(-) =================================================================== @@ -71,7 +71,7 @@ static gint glspi_project(lua_State* L) } } -static gchar *glspi_script_dir = NULL; +static const gchar *glspi_script_dir = NULL; static gint glspi_appinfo(lua_State* L) { @@ -109,7 +109,7 @@ static gint glspi_xsel(lua_State* L) { if (lua_gettop(L)>0) { if (lua_isstring(L,1)) { - guint len; + gsize len; const gchar*txt=lua_tolstring(L,1,&len); gtk_clipboard_set_text(CLIPBOARD,txt,len); } else { @@ -192,7 +192,7 @@ static gint glspi_stat(lua_State* L) if (!lua_isstring(L,1)) { return FAIL_STRING_ARG(1); } fn=lua_tostring(L,1); if (sf(fn,&st)==0) { - gchar *ft=NULL; + const gchar *ft=NULL; switch ( st.st_mode & S_IFMT) { case S_IFBLK:ft="b"; break; case S_IFCHR:ft="c"; break; @@ -347,7 +347,8 @@ static void glspi_init_key_cmd_hash(void) key_cmd_hash=g_hash_table_new(g_str_hash,g_str_equal); for (i=0;key_cmd_hash_entries[i].name; i++) { g_hash_table_insert( - key_cmd_hash,key_cmd_hash_entries[i].name,&key_cmd_hash_entries[i]); + key_cmd_hash,(gpointer) key_cmd_hash_entries[i].name, + &key_cmd_hash_entries[i]); } } @@ -579,7 +580,7 @@ static gint glspi_keygrab(lua_State* L) if (prompt && doc && doc->is_valid ) { gint fvl=scintilla_send_message(doc->editor->sci,SCI_GETFIRSTVISIBLELINE, 0,0); gint pos=sci_get_position_from_line(doc->editor->sci, fvl+1); - scintilla_send_message(doc->editor->sci,SCI_CALLTIPSHOW,pos+3, (gint)prompt); + scintilla_send_message(doc->editor->sci,SCI_CALLTIPSHOW,pos+3, (glong)prompt); } gdk_window_add_filter(main_widgets->window->window, keygrab_cb, &km); do { @@ -620,7 +621,7 @@ static gint glspi_keygrab(lua_State* L) {NULL,NULL} }; -void glspi_init_app_funcs(lua_State *L, gchar*script_dir) { +void glspi_init_app_funcs(lua_State *L, const gchar*script_dir) { glspi_script_dir = script_dir; luaL_register(L, NULL,glspi_app_funcs); } Modified: geanylua/glspi_init.c 6 files changed, 3 insertions(+), 3 deletions(-) =================================================================== @@ -63,7 +63,7 @@ -extern void glspi_run_script(gchar *script_file, gint caller, GKeyFile*proj, gchar *script_dir); +extern void glspi_run_script(const gchar *script_file, gint caller, GKeyFile*proj, const gchar *script_dir); /* Called by Geany, run a script associated with a keybinding. */ @@ -322,7 +322,7 @@ static void assign_accel(GtkWidget*w, char*fn) -static GtkWidget* new_menu(GtkWidget *parent, gchar* script_dir, gchar*title); +static GtkWidget* new_menu(GtkWidget *parent, const gchar* script_dir, const gchar*title); /* GSList "for each" callback to create a menu item for each found script */ static void init_menu(gpointer data, gpointer user_data) @@ -363,7 +363,7 @@ static void init_menu(gpointer data, gpointer user_data) -static GtkWidget* new_menu(GtkWidget *parent, gchar* script_dir, gchar*title) +static GtkWidget* new_menu(GtkWidget *parent, const gchar* script_dir, const gchar*title) { GSList *script_names=utils_get_file_list_full(script_dir, TRUE, TRUE, NULL); if (script_names) { Modified: geanylua/glspi_keycmd.h 2 files changed, 1 insertions(+), 1 deletions(-) =================================================================== @@ -11,7 +11,7 @@ typedef struct _KeyCmdHashEntry { - gchar *name; + const gchar *name; guint group; guint key_id; } KeyCmdHashEntry; Modified: geanylua/glspi_run.c 22 files changed, 11 insertions(+), 11 deletions(-) =================================================================== @@ -23,7 +23,7 @@ /* basic dialog box functions */ extern void glspi_init_dlg_funcs(lua_State *L, GsDlgRunHook hook); /* application functions */ -extern void glspi_init_app_funcs(lua_State *L, gchar*script_dir); +extern void glspi_init_app_funcs(lua_State *L, const gchar*script_dir); /* menu functions */ void glspi_init_mnu_funcs(lua_State *L); @@ -53,7 +53,7 @@ static void repaint_scintilla(void) /* Internal yes-or-no question box (not used by scripts) */ -static gboolean glspi_show_question(gchar*title, gchar*question, gboolean default_result) +static gboolean glspi_show_question(const gchar*title, const gchar*question, gboolean default_result) { GtkWidget *dialog, *yes_btn, *no_btn; GtkResponseType dv, rv; @@ -76,7 +76,7 @@ static gboolean glspi_show_question(gchar*title, gchar*question, gboolean defaul } -static gboolean glspi_goto_error(gchar *fn, gint line) +static gboolean glspi_goto_error(const gchar *fn, gint line) { GeanyDocument *doc=document_open_file(fn, FALSE, NULL, NULL); if (doc) { @@ -103,7 +103,7 @@ static gboolean glspi_goto_error(gchar *fn, gint line) give the user an option to automatically open the file and scroll to the offending line. */ -static void glspi_script_error(gchar *script_file, const gchar *msg, gboolean need_name, gint line) +static void glspi_script_error(const gchar *script_file, const gchar *msg, gboolean need_name, gint line) { GtkWidget *dialog; if (need_name) { @@ -336,7 +336,7 @@ static gint glspi_traceback(lua_State *L) The set_*_token functions assign default values for module-level variables */ -static void set_string_token(lua_State *L, gchar*name, gchar*value) +static void set_string_token(lua_State *L, const gchar*name, const gchar*value) { lua_getglobal(L, LUA_MODULE_NAME); if (lua_istable(L, -1)) { @@ -350,7 +350,7 @@ static void set_string_token(lua_State *L, gchar*name, gchar*value) -static void set_numeric_token(lua_State *L, gchar*name, gint value) +static void set_numeric_token(lua_State *L, const gchar*name, gint value) { lua_getglobal(L, LUA_MODULE_NAME); if (lua_istable(L, -1)) { @@ -364,7 +364,7 @@ static void set_numeric_token(lua_State *L, gchar*name, gint value) -static void set_boolean_token(lua_State *L, gchar*name, gboolean value) +static void set_boolean_token(lua_State *L, const gchar*name, gboolean value) { lua_getglobal(L, LUA_MODULE_NAME); if (lua_istable(L, -1)) { @@ -378,7 +378,7 @@ static void set_boolean_token(lua_State *L, gchar*name, gboolean value) -static void set_keyfile_token(lua_State *L, gchar*name, GKeyFile* value) +static void set_keyfile_token(lua_State *L, const gchar*name, GKeyFile* value) { if (!value) {return;} lua_getglobal(L, LUA_MODULE_NAME); @@ -393,7 +393,7 @@ static void set_keyfile_token(lua_State *L, gchar*name, GKeyFile* value) -static void show_error(lua_State *L, gchar *script_file) +static void show_error(lua_State *L, const gchar *script_file) { gint line=-1; gchar *fn = glspi_get_error_info(L, &line); @@ -413,7 +413,7 @@ static void show_error(lua_State *L, gchar *script_file) -static gint glspi_init_module(lua_State *L, gchar *script_file, gint caller, GKeyFile*proj, gchar*script_dir) +static gint glspi_init_module(lua_State *L, const gchar *script_file, gint caller, GKeyFile*proj, const gchar*script_dir) { luaL_openlib(L, LUA_MODULE_NAME, glspi_timer_funcs, 0); glspi_init_sci_funcs(L); @@ -450,7 +450,7 @@ gint luaopen_libgeanylua(lua_State *L) /* Load and run the script */ -void glspi_run_script(gchar *script_file, gint caller, GKeyFile*proj, gchar *script_dir) +void glspi_run_script(const gchar *script_file, gint caller, GKeyFile*proj, const gchar *script_dir) { gint status; lua_State *L = glspi_state_new(); Modified: geanylua/glspi_sci.c 9 files changed, 5 insertions(+), 4 deletions(-) =================================================================== @@ -467,7 +467,7 @@ static gint glspi_copy(lua_State* L) if (!lua_isstring(L,1)) {return FAIL_STRING_ARG(1);} content=lua_tostring(L,1); len=strlen(content); - if (len) { scintilla_send_message(doc->editor->sci,SCI_COPYTEXT,len,(gint)content); } + if (len) { scintilla_send_message(doc->editor->sci,SCI_COPYTEXT,len,(glong)content); } push_number(L, len); return 1; default: @@ -561,7 +561,8 @@ static void glspi_init_sci_cmd_hash(void) sci_cmd_hash=g_hash_table_new(g_str_hash,g_str_equal); for (i=0; sci_cmd_hash_entries[i].name; i++) { g_hash_table_insert( - sci_cmd_hash,sci_cmd_hash_entries[i].name,&sci_cmd_hash_entries[i]); + sci_cmd_hash, + (gpointer) sci_cmd_hash_entries[i].name,&sci_cmd_hash_entries[i]); } } @@ -596,7 +597,7 @@ static SciCmdHashEntry* lookup_cmd_id(gint cmd) -static gint glspi_fail_not_implemented(lua_State* L, const gchar*funcname, gchar*cmdname) +static gint glspi_fail_not_implemented(lua_State* L, const gchar*funcname, const gchar*cmdname) { lua_pushfstring( L, _( "Error in module \"%s\" at function %s():\n" @@ -607,7 +608,7 @@ static gint glspi_fail_not_implemented(lua_State* L, const gchar*funcname, gchar } -static gint glspi_fail_arg_count(lua_State* L, const gchar*funcname, gchar*cmdname) +static gint glspi_fail_arg_count(lua_State* L, const gchar*funcname, const gchar*cmdname) { lua_pushfstring( L, _( "Error in module \"%s\" at function %s():\n" Modified: geanylua/glspi_sci.h 2 files changed, 1 insertions(+), 1 deletions(-) =================================================================== @@ -25,7 +25,7 @@ typedef struct _SciCmdHashEntry { - gchar *name; + const gchar *name; GlspiType result; gint msgid; GlspiType wparam; Modified: geanylua/gsdlg_lua.c 4 files changed, 2 insertions(+), 2 deletions(-) =================================================================== @@ -90,7 +90,7 @@ static gint adjust_argnum(lua_State *L, gint argnum) { /* Pushes an error message onto Lua stack if script passes a wrong arg type */ -static gint fail_arg_type(lua_State *L, const gchar *func, gint argnum, gchar *type) +static gint fail_arg_type(lua_State *L, const gchar *func, gint argnum, const gchar *type) { lua_pushfstring(L, _("Error in module \"%s\" at function %s():\n" " expected type \"%s\" for argument #%d\n"), @@ -103,7 +103,7 @@ static gint fail_arg_type(lua_State *L, const gchar *func, gint argnum, gchar *t /*Pushes an error message onto Lua stack if table contains wrong element type*/ static gint gsdl_fail_elem_type( - lua_State *L, const gchar *func, gint argnum, gint idx, gchar *type) + lua_State *L, const gchar *func, gint argnum, gint idx, const gchar *type) { lua_pushfstring(L, _("Error in module \"%s\" at function %s():\n" " invalid table in argument #%d:\n" @@ Diff output truncated at 100000 characters. @@ -------------- This E-Mail was brought to you by github_commit_mail.py (Source: TBD).
1
0
0
0
← Newer
1
2
3
4
5
6
7
8
9
10
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
Results per page:
10
25
50
100
200