Re: [PATCH 1/2] virNetServerClientNewPostExecRestart: Drop useless typecasts

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

 



On 05/05/16 09:30, Michal Privoznik wrote:
> In this function, @id is defined as unsigned long long. When
> passing this variable to virJSONValueObjectGetNumberUlong(),
> well address of this variable, it's typecasted to ull*. There
> is no need for that. It's a same story with @nrequests_max.
> 
> Signed-off-by: Michal Privoznik <mprivozn@xxxxxxxxxx>
> ---
>  src/rpc/virnetserverclient.c | 5 ++---
>  1 file changed, 2 insertions(+), 3 deletions(-)
> 
> diff --git a/src/rpc/virnetserverclient.c b/src/rpc/virnetserverclient.c
> index d38f421..d3a3a18 100644
> --- a/src/rpc/virnetserverclient.c
> +++ b/src/rpc/virnetserverclient.c
> @@ -485,7 +485,7 @@ virNetServerClientPtr virNetServerClientNewPostExecRestart(virJSONValuePtr objec
>          return NULL;
>      }
>      if (virJSONValueObjectGetNumberUint(object, "nrequests_max",
> -                                        (unsigned int *)&nrequests_max) < 0) {
> +                                        &nrequests_max) < 0) {
>          virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
>                         _("Missing nrequests_client_max field in JSON state document"));
>          return NULL;
> @@ -501,8 +501,7 @@ virNetServerClientPtr virNetServerClientNewPostExecRestart(virJSONValuePtr objec
>          /* no ID found in, a new one must be generated */
>          id = virNetServerNextClientID((virNetServerPtr) opaque);
>      } else {
> -        if (virJSONValueObjectGetNumberUlong(object, "id",
> -                                        (unsigned long long *) &id) < 0) {
> +        if (virJSONValueObjectGetNumberUlong(object, "id", &id) < 0) {
>          virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
>                         _("Malformed id field in JSON state document"));
>          return NULL;
> 

ACK

Erik

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]