qemu-trivial
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-trivial] [Qemu-devel] [PATCH] qom/object: fix 2 comment typos


From: Peter Maydell
Subject: Re: [Qemu-trivial] [Qemu-devel] [PATCH] qom/object: fix 2 comment typos
Date: Mon, 2 Nov 2015 11:34:25 +0000

On 2 November 2015 at 09:04, Cao jin <address@hidden> wrote:
> Signed-off-by: Cao jin <address@hidden>
> ---
>  include/qom/object.h | 2 +-
>  qom/object.c         | 2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/include/qom/object.h b/include/qom/object.h
> index be7280c..9e5162a 100644
> --- a/include/qom/object.h
> +++ b/include/qom/object.h
> @@ -511,7 +511,7 @@ struct TypeInfo
>  /**
>   * OBJECT_CLASS_CHECK:
>   * @class: The C type to use for the return value.
> - * @obj: A derivative of @type to cast.
> + * @obj: A derivative class of @class to cast.
>   * @name: the QOM typename of @class.

I think this is right but not sufficient. Since OBJECT_CLASS_CHECK's
second parameter is not an object but a class, the name "obj" is
rather misleading and should be changed. My suggestion would be
to use

 * @classtype: The C type to use for the return value.
 * @class: A derivative class of @classtype to cast.
 * @name: the QOM typename of @class.

(and the macro definition parameter names should change to match).

>   *
>   * A type safe version of @object_class_dynamic_cast_assert.  This macro is
> diff --git a/qom/object.c b/qom/object.c
> index 11cd86b..fc6e161 100644
> --- a/qom/object.c
> +++ b/qom/object.c
> @@ -204,7 +204,7 @@ static bool type_is_ancestor(TypeImpl *type, TypeImpl 
> *target_type)
>  {
>      assert(target_type);
>
> -    /* Check if typename is a direct ancestor of type */
> +    /* Check if target_type is a direct ancestor of type */
>      while (type) {
>          if (type == target_type) {
>              return true;

This change is good.

thanks
-- PMM



reply via email to

[Prev in Thread] Current Thread [Next in Thread]