Re: [PATCH v2 04/10] ruby: simplify data get helper

Subject: Re: [PATCH v2 04/10] ruby: simplify data get helper

Date: Wed, 12 May 2021 18:59:39 -0300

To: Felipe Contreras, notmuch@notmuchmail.org

Cc:

From: David Bremner


Felipe Contreras <felipe.contreras@gmail.com> writes:

> The type is not actually needed.
>
> Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
> ---
>  bindings/ruby/defs.h | 22 +++++++++++-----------
>  1 file changed, 11 insertions(+), 11 deletions(-)
>
> diff --git a/bindings/ruby/defs.h b/bindings/ruby/defs.h
> index 46e2caf8..8fb47b4c 100644
> --- a/bindings/ruby/defs.h
> +++ b/bindings/ruby/defs.h
> @@ -55,39 +55,39 @@ extern ID ID_db_mode;
>  # define RSTRING_PTR(v) (RSTRING((v))->ptr)
>  #endif /* !defined (RSTRING_PTR) */
>  
> -#define Data_Get_Notmuch_Object(obj, type, message, ptr)	\
> +#define Data_Get_Notmuch_Object(obj, message, ptr)		\
>      do {							\
> -	Data_Get_Struct ((obj), type, (ptr));			\
> +	(ptr) = rb_data_object_get ((obj));			\

Please explain a bit more in the commit message what's going on
here. Why is it OK to replace Data_Get_Struct with rb_data_object_get?

_______________________________________________
notmuch mailing list -- notmuch@notmuchmail.org
To unsubscribe send an email to notmuch-leave@notmuchmail.org

Thread: