unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
* [PATCH 1/2] make _alloc_notmuch static
@ 2021-05-24  0:08 David Bremner
  2021-05-24  0:08 ` [PATCH 2/2] lib/message: use passed database for error handling David Bremner
  2021-05-24 11:29 ` [PATCH 1/2] make _alloc_notmuch static Tomi Ollila
  0 siblings, 2 replies; 4+ messages in thread
From: David Bremner @ 2021-05-24  0:08 UTC (permalink / raw)
  To: notmuch; +Cc: David Bremner

It is not used outside this file, so being extern seems like an oversight
---
 lib/open.cc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/open.cc b/lib/open.cc
index 1ca69665..bf166e15 100644
--- a/lib/open.cc
+++ b/lib/open.cc
@@ -242,7 +242,7 @@ _choose_database_path (void *ctx,
     return NOTMUCH_STATUS_SUCCESS;
 }
 
-notmuch_database_t *
+static notmuch_database_t *
 _alloc_notmuch ()
 {
     notmuch_database_t *notmuch;
-- 
2.30.2

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH 2/2] lib/message: use passed database for error handling
  2021-05-24  0:08 [PATCH 1/2] make _alloc_notmuch static David Bremner
@ 2021-05-24  0:08 ` David Bremner
  2021-05-24 11:29 ` [PATCH 1/2] make _alloc_notmuch static Tomi Ollila
  1 sibling, 0 replies; 4+ messages in thread
From: David Bremner @ 2021-05-24  0:08 UTC (permalink / raw)
  To: notmuch; +Cc: David Bremner

'message' should always be initialized if we reach here, but in case it
is not, we still want to be able to log an error message.
---
 lib/message.cc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/message.cc b/lib/message.cc
index 7af6ab82..8a67e2a5 100644
--- a/lib/message.cc
+++ b/lib/message.cc
@@ -288,7 +288,7 @@ _notmuch_message_create_for_message_id (notmuch_database_t *notmuch,
 
 	doc_id = _notmuch_database_generate_doc_id (notmuch);
     } catch (const Xapian::Error &error) {
-	_notmuch_database_log (notmuch_message_get_database (message),
+	_notmuch_database_log (notmuch,
 			       "A Xapian exception occurred creating message: %s\n",
 			       error.get_msg ().c_str ());
 	notmuch->exception_reported = true;
-- 
2.30.2

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH 1/2] make _alloc_notmuch static
  2021-05-24  0:08 [PATCH 1/2] make _alloc_notmuch static David Bremner
  2021-05-24  0:08 ` [PATCH 2/2] lib/message: use passed database for error handling David Bremner
@ 2021-05-24 11:29 ` Tomi Ollila
  2021-06-07 23:32   ` David Bremner
  1 sibling, 1 reply; 4+ messages in thread
From: Tomi Ollila @ 2021-05-24 11:29 UTC (permalink / raw)
  To: David Bremner, notmuch

On Sun, May 23 2021, David Bremner wrote:

> It is not used outside this file, so being extern seems like an oversight
> ---
>  lib/open.cc | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/lib/open.cc b/lib/open.cc
> index 1ca69665..bf166e15 100644
> --- a/lib/open.cc
> +++ b/lib/open.cc
> @@ -242,7 +242,7 @@ _choose_database_path (void *ctx,
>      return NOTMUCH_STATUS_SUCCESS;
>  }
>  
> -notmuch_database_t *
> +static notmuch_database_t *
>  _alloc_notmuch ()
>  {
>      notmuch_database_t *notmuch;

could also add static to _maybe_load_config_from_database()
in the same file (open.cc) and to
_notmuch_message_remove_indexed_terms() in message.cc

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH 1/2] make _alloc_notmuch static
  2021-05-24 11:29 ` [PATCH 1/2] make _alloc_notmuch static Tomi Ollila
@ 2021-06-07 23:32   ` David Bremner
  0 siblings, 0 replies; 4+ messages in thread
From: David Bremner @ 2021-06-07 23:32 UTC (permalink / raw)
  To: Tomi Ollila, notmuch

Tomi Ollila <tomi.ollila@iki.fi> writes:

>
> could also add static to _maybe_load_config_from_database()
> in the same file (open.cc) and to
> _notmuch_message_remove_indexed_terms() in message.cc

applied to master, with all 3 made static

d

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-06-07 23:32 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-05-24  0:08 [PATCH 1/2] make _alloc_notmuch static David Bremner
2021-05-24  0:08 ` [PATCH 2/2] lib/message: use passed database for error handling David Bremner
2021-05-24 11:29 ` [PATCH 1/2] make _alloc_notmuch static Tomi Ollila
2021-06-07 23:32   ` David Bremner

Code repositories for project(s) associated with this public inbox

	https://yhetil.org/notmuch.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).