diff --git a/guile/Makefile.am b/guile/Makefile.am index 64055cad..e9ef556d 100644 --- a/guile/Makefile.am +++ b/guile/Makefile.am @@ -35,6 +35,13 @@ AM_CFLAGS= \ -Wno-missing-prototypes \ -Wno-missing-declarations +AM_CXXFLAGS= \ + $(ASAN_CFLAGS) \ + ${WARN_CXXFLAGS} \ + -Wno-redundant-decls \ + -Wno-missing-declarations \ + -Wno-suggest-attribute=noreturn + lib_LTLIBRARIES= \ libguile-mu.la @@ -45,6 +52,7 @@ libguile_mu_la_SOURCES= \ mu-guile-message.hh libguile_mu_la_CFLAGS=$(AM_CFLAGS) +libguile_mu_la_CXXFLAGS=$(AM_CXXFLAGS) libguile_mu_la_LIBADD= \ ${top_builddir}/lib/libmu.la \ @@ -67,12 +75,14 @@ mu_guile_TEXINFOS= \ BUILT_SOURCES=$(XFILES) -snarfcppopts= $(DEFS) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +snarfcopts= $(DEFS) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +snarfcxxopts= $(DEFS) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) + SUFFIXES = .x .doc .c.x: - $(AM_V_GEN) $(GUILE_SNARF) -o $@ $< $(snarfcppopts) + $(AM_V_GEN) $(GUILE_SNARF) -o $@ $< $(snarfcopts) .cc.x: - $(AM_V_GEN) $(GUILE_SNARF) -o $@ $< $(snarfcppopts) + $(AM_V_GEN) $(GUILE_SNARF) -o $@ $< $(snarfcxxopts) # FIXME: GUILE_SITEDIR would be better, but that diff --git a/guile/mu-guile-message.cc b/guile/mu-guile-message.cc index ef58e988..2716122a 100644 --- a/guile/mu-guile-message.cc +++ b/guile/mu-guile-message.cc @@ -27,7 +27,7 @@ #include "mu-guile.hh" -#include +#include #include #include #include diff --git a/guile/mu-guile.cc b/guile/mu-guile.cc index f1b10a47..c148f0e2 100644 --- a/guile/mu-guile.cc +++ b/guile/mu-guile.cc @@ -28,7 +28,7 @@ #include #pragma GCC diagnostic pop -#include +#include #include #include #include diff --git a/lib/Makefile.am b/lib/Makefile.am index f7bc4ca2..710f5c9a 100644 --- a/lib/Makefile.am +++ b/lib/Makefile.am @@ -59,17 +59,36 @@ noinst_LTLIBRARIES= \ libmu.la libmu_la_SOURCES= \ - mu-bookmarks.c \ - mu-bookmarks.h \ + mu-bookmarks.cc \ + mu-bookmarks.hh \ mu-contacts.cc \ mu-contacts.hh \ mu-container.cc \ mu-container.hh \ mu-data.hh \ + mu-parser.cc \ + mu-parser.hh \ + mu-query.cc \ + mu-query.hh \ + mu-runtime.cc \ + mu-runtime.hh \ + mu-script.cc \ + mu-script.hh \ + mu-server.cc \ + mu-server.hh \ + mu-store.cc \ + mu-store.hh \ + mu-threader.cc \ + mu-threader.hh \ + mu-tokenizer.cc \ + mu-tokenizer.hh \ + mu-tree.hh \ + mu-xapian.cc \ + mu-xapian.hh \ mu-flags.c \ - mu-flags.h \ mu-maildir.c \ mu-maildir.h \ + mu-flags.h \ mu-msg-crypto.c \ mu-msg-doc.cc \ mu-msg-doc.h \ @@ -86,27 +105,7 @@ libmu_la_SOURCES= \ mu-msg-priv.h \ mu-msg-sexp.cc \ mu-msg.c \ - mu-msg.h \ - mu-msg.h \ - mu-parser.cc \ - mu-parser.hh \ - mu-query.cc \ - mu-query.hh \ - mu-runtime.cc \ - mu-runtime.h \ - mu-script.c \ - mu-script.h \ - mu-server.cc \ - mu-server.hh \ - mu-store.cc \ - mu-store.hh \ - mu-threader.cc \ - mu-threader.hh \ - mu-tokenizer.cc \ - mu-tokenizer.hh \ - mu-tree.hh \ - mu-xapian.cc \ - mu-xapian.hh + mu-msg.h libmu_la_LIBADD= \ $(XAPIAN_LIBS) \ diff --git a/lib/mu-bookmarks.c b/lib/mu-bookmarks.cc similarity index 92% rename from lib/mu-bookmarks.c rename to lib/mu-bookmarks.cc index 2f1ebac5..5f2c0ae1 100644 --- a/lib/mu-bookmarks.c +++ b/lib/mu-bookmarks.cc @@ -1,6 +1,5 @@ -/* -*-mode: c; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-*/ /* -** Copyright (C) 2010-2013 Dirk-Jan C. Binnema +** Copyright (C) 2010-2020 Dirk-Jan C. Binnema ** ** This program is free software; you can redistribute it and/or modify it ** under the terms of the GNU General Public License as published by the @@ -19,11 +18,11 @@ */ #include -#include "mu-bookmarks.h" +#include "mu-bookmarks.hh" #define MU_BOOKMARK_GROUP "mu" -struct _MuBookmarks { +struct MuBookmarks { char *_bmpath; GHashTable *_hash; }; @@ -113,7 +112,7 @@ mu_bookmarks_lookup (MuBookmarks *bm, const gchar *name) g_return_val_if_fail (bm, NULL); g_return_val_if_fail (name, NULL); - return g_hash_table_lookup (bm->_hash, name); + return (const char*)g_hash_table_lookup (bm->_hash, name); } struct _BMData { diff --git a/lib/mu-bookmarks.h b/lib/mu-bookmarks.hh similarity index 91% rename from lib/mu-bookmarks.h rename to lib/mu-bookmarks.hh index 2f1d99f4..a30dceba 100644 --- a/lib/mu-bookmarks.h +++ b/lib/mu-bookmarks.hh @@ -1,5 +1,5 @@ /* -** Copyright (C) 2008-2013 Dirk-Jan C. Binnema +** Copyright (C) 2008-2020 Dirk-Jan C. Binnema ** ** This program is free software; you can redistribute it and/or modify it ** under the terms of the GNU General Public License as published by the @@ -17,23 +17,20 @@ ** */ -#ifndef __MU_BOOKMARKS_H__ -#define __MU_BOOKMARKS_H__ +#ifndef MU_BOOKMARKS_HH__ +#define MU_BOOKMARKS_HH__ #include - -G_BEGIN_DECLS /** * @addtogroup MuBookmarks * Functions for dealing with bookmarks * @{ */ -struct _MuBookmarks; /*! \struct MuBookmarks * \brief Opaque structure representing a sequence of bookmarks */ -typedef struct _MuBookmarks MuBookmarks; +struct MuBookmarks; /** @@ -81,6 +78,4 @@ void mu_bookmarks_foreach (MuBookmarks *bm, MuBookmarksForeachFunc func, /** @} */ -G_END_DECLS - #endif /*__MU_BOOKMARKS_H__*/ diff --git a/lib/mu-msg-file.c b/lib/mu-msg-file.c index 121af38f..df733268 100644 --- a/lib/mu-msg-file.c +++ b/lib/mu-msg-file.c @@ -1,6 +1,5 @@ -/* -*- mode: c; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- -** -** Copyright (C) 2012-2013 Dirk-Jan C. Binnema +/* +** Copyright (C) 2012-2020 Dirk-Jan C. Binnema ** ** This program is free software; you can redistribute it and/or modify it ** under the terms of the GNU General Public License as published by the diff --git a/lib/mu-runtime.cc b/lib/mu-runtime.cc index 6d046938..491b9f22 100644 --- a/lib/mu-runtime.cc +++ b/lib/mu-runtime.cc @@ -1,5 +1,5 @@ /* -** Copyright (C) 2019 Dirk-Jan C. Binnema +** Copyright (C) 2019-2020 Dirk-Jan C. Binnema ** ** This program is free software; you can redistribute it and/or modify it ** under the terms of the GNU General Public License as published by the @@ -17,7 +17,7 @@ ** */ -#include "mu-runtime.h" +#include "mu-runtime.hh" #include "utils/mu-util.h" #include "utils/mu-logger.hh" diff --git a/lib/mu-runtime.h b/lib/mu-runtime.hh similarity index 100% rename from lib/mu-runtime.h rename to lib/mu-runtime.hh diff --git a/lib/mu-script.c b/lib/mu-script.cc similarity index 95% rename from lib/mu-script.c rename to lib/mu-script.cc index c5b167fb..1175a60e 100644 --- a/lib/mu-script.c +++ b/lib/mu-script.cc @@ -17,9 +17,7 @@ ** */ -#if HAVE_CONFIG_H #include "config.h" -#endif /*HAVE_CONFIG_H*/ #ifdef BUILD_GUILE @@ -37,14 +35,14 @@ #include #include "utils/mu-str.h" -#include "mu-script.h" +#include "mu-script.hh" #include "utils/mu-util.h" /** * Structure with information about a certain script. * the values will be *freed* when MuScriptInfo is freed */ -struct _MuScriptInfo { +struct MuScriptInfo { char *_name; /* filename-sans-extension */ char *_path; /* full path to script */ char *_oneline; /* one-line description */ @@ -121,15 +119,17 @@ mu_script_info_matches_regex (MuScriptInfo *msi, const char *rxstr, g_return_val_if_fail (msi, FALSE); g_return_val_if_fail (rxstr, FALSE); - rx = g_regex_new (rxstr, G_REGEX_CASELESS|G_REGEX_OPTIMIZE, 0, err); + rx = g_regex_new (rxstr, + (GRegexCompileFlags)(G_REGEX_CASELESS|G_REGEX_OPTIMIZE), + (GRegexMatchFlags)0, err); if (!rx) return FALSE; match = FALSE; if (msi->_name) - match = g_regex_match (rx, msi->_name, 0, NULL); + match = g_regex_match (rx, msi->_name, (GRegexMatchFlags)0, NULL); if (!match && msi->_oneline) - match = g_regex_match (rx, msi->_oneline, 0, NULL); + match = g_regex_match (rx, msi->_oneline,(GRegexMatchFlags)0, NULL); return match; } diff --git a/lib/mu-script.h b/lib/mu-script.hh similarity index 93% rename from lib/mu-script.h rename to lib/mu-script.hh index 586b6f0b..349fc806 100644 --- a/lib/mu-script.h +++ b/lib/mu-script.hh @@ -1,5 +1,5 @@ /* -** Copyright (C) 2012-2013 Dirk-Jan C. Binnema +** Copyright (C) 2012-2020 Dirk-Jan C. Binnema ** ** This program is free software; you can redistribute it and/or modify it ** under the terms of the GNU General Public License as published by the @@ -17,16 +17,13 @@ ** */ -#ifndef __MU_SCRIPT_H__ -#define __MU_SCRIPT_H__ +#ifndef MU_SCRIPT_HH__ +#define MU_SCRIPT_HH__ #include -G_BEGIN_DECLS - /* Opaque structure with information about a script */ -struct _MuScriptInfo; -typedef struct _MuScriptInfo MuScriptInfo; +struct MuScriptInfo; /** * get the name of the script (sans-extension, if some extension was @@ -127,6 +124,4 @@ MuScriptInfo* mu_script_find_script_with_name (GSList *lst, const char *name); gboolean mu_script_guile_run (MuScriptInfo *msi, const char *muhome, const char **args, GError **err); -G_END_DECLS - -#endif /*__MU_SCRIPT_H__*/ +#endif /*MU_SCRIPT_HH__*/ diff --git a/lib/mu-server.cc b/lib/mu-server.cc index 604ea5d2..9fb6ff19 100644 --- a/lib/mu-server.cc +++ b/lib/mu-server.cc @@ -35,7 +35,7 @@ #include #include "mu-msg.h" -#include "mu-runtime.h" +#include "mu-runtime.hh" #include "mu-maildir.h" #include "mu-query.hh" #include "index/mu-indexer.hh" diff --git a/mu/mu-cmd-cfind.cc b/mu/mu-cmd-cfind.cc index 20d9db6e..5b8c4c80 100644 --- a/mu/mu-cmd-cfind.cc +++ b/mu/mu-cmd-cfind.cc @@ -27,7 +27,7 @@ #include "mu-cmd.hh" #include "mu-contacts.hh" -#include "mu-runtime.h" +#include "mu-runtime.hh" #include "utils/mu-util.h" #include "utils/mu-utils.hh" diff --git a/mu/mu-cmd-find.cc b/mu/mu-cmd-find.cc index 80950fa5..c6634991 100644 --- a/mu/mu-cmd-find.cc +++ b/mu/mu-cmd-find.cc @@ -32,8 +32,8 @@ #include "mu-maildir.h" #include "mu-query.hh" #include "mu-msg-iter.h" -#include "mu-bookmarks.h" -#include "mu-runtime.h" +#include "mu-bookmarks.hh" +#include "mu-runtime.hh" #include "utils/mu-util.h" #include "utils/mu-str.h" diff --git a/mu/mu-cmd-index.cc b/mu/mu-cmd-index.cc index 2db4d2d1..f972974e 100644 --- a/mu/mu-cmd-index.cc +++ b/mu/mu-cmd-index.cc @@ -33,7 +33,7 @@ #include "mu-msg.h" #include "index/mu-indexer.hh" #include "mu-store.hh" -#include "mu-runtime.h" +#include "mu-runtime.hh" #include "utils/mu-util.h" diff --git a/mu/mu-cmd-script.cc b/mu/mu-cmd-script.cc index 5a74f5f4..fefdbd3c 100644 --- a/mu/mu-cmd-script.cc +++ b/mu/mu-cmd-script.cc @@ -1,7 +1,5 @@ -/* -*-mode: c; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-*/ - /* -** Copyright (C) 2012-2013 Dirk-Jan C. Binnema +** Copyright (C) 2012-2020 Dirk-Jan C. Binnema ** ** This program is free software; you can redistribute it and/or modify it ** under the terms of the GNU General Public License as published by the @@ -30,8 +28,8 @@ #include #include "mu-cmd.hh" -#include "mu-script.h" -#include "mu-runtime.h" +#include "mu-script.hh" +#include "mu-runtime.hh" #include "utils/mu-util.h" diff --git a/mu/mu-cmd-server.cc b/mu/mu-cmd-server.cc index afd75850..382c817e 100644 --- a/mu/mu-cmd-server.cc +++ b/mu/mu-cmd-server.cc @@ -24,7 +24,7 @@ #include #include -#include "mu-runtime.h" +#include "mu-runtime.hh" #include "mu-cmd.hh" #include "mu-server.hh" diff --git a/mu/mu-cmd.cc b/mu/mu-cmd.cc index 76dc7d91..3a65f21a 100644 --- a/mu/mu-cmd.cc +++ b/mu/mu-cmd.cc @@ -34,7 +34,7 @@ #include "mu-cmd.hh" #include "mu-maildir.h" #include "mu-contacts.hh" -#include "mu-runtime.h" +#include "mu-runtime.hh" #include "mu-flags.h" #include "utils/mu-util.h" diff --git a/mu/mu.cc b/mu/mu.cc index 18c5b54f..9dff2aee 100644 --- a/mu/mu.cc +++ b/mu/mu.cc @@ -25,7 +25,7 @@ #include "mu-config.hh" #include "mu-cmd.hh" -#include "mu-runtime.h" +#include "mu-runtime.hh" #include "utils/mu-utils.hh" using namespace Mu; diff --git a/toys/mug/Makefile.am b/toys/mug/Makefile.am index 5787c713..306b0914 100644 --- a/toys/mug/Makefile.am +++ b/toys/mug/Makefile.am @@ -1,4 +1,4 @@ -## Copyright (C) 2008-2019 Dirk-Jan C. Binnema +## Copyright (C) 2008-2020 Dirk-Jan C. Binnema ## ## This program is free software; you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by @@ -35,7 +35,7 @@ AM_CFLAGS= \ -Wno-deprecated-declarations \ -Wno-switch-enum -AM_CXXFLAGS=$(AM_CFLAGS) $(WARN_CXXFLAGS) +AM_CXXFLAGS=$(WARN_CXXFLAGS) # # Distributors: this is a _toy_, not for distribution. the "noinst_" says enough @@ -44,17 +44,15 @@ noinst_PROGRAMS= \ mug mug_SOURCES= \ - mug.c \ + mug.cc \ mug-msg-list-view.cc \ mug-msg-list-view.h \ mug-msg-view.h \ mug-msg-view.c \ mug-query-bar.h \ mug-query-bar.c \ - mug-shortcuts.c \ - mug-shortcuts.h \ - dummy.cc - + mug-shortcuts.cc \ + mug-shortcuts.h DISTCLEANFILES= \ $(BUILT_SOURCES) diff --git a/toys/mug/mug-shortcuts.c b/toys/mug/mug-shortcuts.cc similarity index 96% rename from toys/mug/mug-shortcuts.c rename to toys/mug/mug-shortcuts.cc index 316bd090..ed964f3e 100644 --- a/toys/mug/mug-shortcuts.c +++ b/toys/mug/mug-shortcuts.cc @@ -1,5 +1,5 @@ /* -** Copyright (C) 2010 Dirk-Jan C. Binnema +** Copyright (C) 2010-2020 Dirk-Jan C. Binnema ** ** This program is free software; you can redistribute it and/or modify it ** under the terms of the GNU General Public License as published by the @@ -18,7 +18,7 @@ */ #include "mug-shortcuts.h" -#include "mu-bookmarks.h" +#include "mu-bookmarks.hh" /* include other impl specific header files */ @@ -58,7 +58,7 @@ mug_shortcuts_class_init (MugShortcutsClass * klass) GObjectClass *gobject_class; gobject_class = (GObjectClass *) klass; - parent_class = g_type_class_peek_parent (klass); + parent_class = (GtkBoxClass*)g_type_class_peek_parent (klass); gobject_class->finalize = mug_shortcuts_finalize; g_type_class_add_private (gobject_class, sizeof (MugShortcutsPrivate)); diff --git a/toys/mug/mug.c b/toys/mug/mug.cc similarity index 99% rename from toys/mug/mug.c rename to toys/mug/mug.cc index fb200133..5833ee4a 100644 --- a/toys/mug/mug.c +++ b/toys/mug/mug.cc @@ -25,7 +25,7 @@ #include #include -#include +#include #include "mug-msg-list-view.h" #include "mug-query-bar.h"