[PATCH 4/4] Explicitly type void* pointers

Jani Nikula jani at nikula.org
Mon Apr 9 04:04:36 PDT 2012


Hi, does notmuch not compile without this? IIRC talloc_steal is a macro
that's supposed to provide type safety (at least with GCC), and I'd be
hesitant about adding the casts. Please look in your talloc.h.

BR,
Jani.

On Apr 9, 2012 1:19 PM, <Vladimir.Marek at oracle.com> wrote:
>
> From: Vladimir Marek <vlmarek at volny.cz>
>
>
> Signed-off-by: Vladimir Marek <vlmarek at volny.cz>
> ---
>  lib/database.cc |    2 +-
>  lib/message.cc  |    2 +-
>  lib/thread.cc   |    2 +-
>  3 files changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/lib/database.cc b/lib/database.cc
> index 16c4354..3c82632 100644
> --- a/lib/database.cc
> +++ b/lib/database.cc
> @@ -1361,7 +1361,7 @@ _resolve_message_id_to_thread_id
(notmuch_database_t *notmuch,
>        return status;
>
>     if (message) {
> -       *thread_id_ret = talloc_steal (ctx,
> +       *thread_id_ret = (const char*)talloc_steal (ctx,
>                                       notmuch_message_get_thread_id
(message));
>
>        notmuch_message_destroy (message);
> diff --git a/lib/message.cc b/lib/message.cc
> index 0075425..d56d442 100644
> --- a/lib/message.cc
> +++ b/lib/message.cc
> @@ -220,7 +220,7 @@ _notmuch_message_create_for_message_id
(notmuch_database_t *notmuch,
>
 message_id,
>
 &message);
>     if (message)
> -       return talloc_steal (notmuch, message);
> +       return (notmuch_message_t*) talloc_steal (notmuch, message);
>     else if (*status_ret)
>        return NULL;
>
> diff --git a/lib/thread.cc b/lib/thread.cc
> index e976d64..d41ff3e 100644
> --- a/lib/thread.cc
> +++ b/lib/thread.cc
> @@ -225,7 +225,7 @@ _thread_add_message (notmuch_thread_t *thread,
>     char *clean_author;
>
>     _notmuch_message_list_add_message (thread->message_list,
> -                                      talloc_steal (thread, message));
> +                                      (_notmuch_message*)talloc_steal
(thread, message));
>     thread->total_messages++;
>
>     g_hash_table_insert (thread->message_hash,
> --
> 1.7.3.2
>
> _______________________________________________
> notmuch mailing list
> notmuch at notmuchmail.org
> http://notmuchmail.org/mailman/listinfo/notmuch
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://notmuchmail.org/pipermail/notmuch/attachments/20120409/31478ded/attachment.html>


More information about the notmuch mailing list