qemu-block
[Top][All Lists]
Advanced

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

Re: [Qemu-block] [Qemu-devel] [PATCH v2 7/7] block/curl: code cleanup to


From: Eric Blake
Subject: Re: [Qemu-block] [Qemu-devel] [PATCH v2 7/7] block/curl: code cleanup to comply with coding style
Date: Wed, 30 Aug 2017 14:53:53 -0500
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0

On 08/30/2017 11:57 AM, Jeff Cody wrote:
> This addresses non-functional changes to help curl.c better comply
> with the coding styles (comments, indentation, brackets, etc.).
> 
> One minor code change is the combination of two if statements into
> a single if statement.
> 
> Signed-off-by: Jeff Cody <address@hidden>
> ---
>  block/curl.c | 100 
> +++++++++++++++++++++++++++++++----------------------------
>  1 file changed, 52 insertions(+), 48 deletions(-)
> 

> -#define CURL_BLOCK_OPT_URL       "url"
> -#define CURL_BLOCK_OPT_READAHEAD "readahead"
> -#define CURL_BLOCK_OPT_SSLVERIFY "sslverify"
> -#define CURL_BLOCK_OPT_TIMEOUT "timeout"
> -#define CURL_BLOCK_OPT_COOKIE    "cookie"
> -#define CURL_BLOCK_OPT_COOKIE_SECRET "cookie-secret"
> -#define CURL_BLOCK_OPT_USERNAME "username"
> -#define CURL_BLOCK_OPT_PASSWORD_SECRET "password-secret"
> -#define CURL_BLOCK_OPT_PROXY_USERNAME "proxy-username"

Another change from inconsistent spacing,

> +#define CURL_BLOCK_OPT_URL                   "url"
> +#define CURL_BLOCK_OPT_READAHEAD             "readahead"
> +#define CURL_BLOCK_OPT_SSLVERIFY             "sslverify"
> +#define CURL_BLOCK_OPT_TIMEOUT               "timeout"
> +#define CURL_BLOCK_OPT_COOKIE                "cookie"
> +#define CURL_BLOCK_OPT_COOKIE_SECRET         "cookie-secret"
> +#define CURL_BLOCK_OPT_USERNAME              "username"
> +#define CURL_BLOCK_OPT_PASSWORD_SECRET       "password-secret"
> +#define CURL_BLOCK_OPT_PROXY_USERNAME        "proxy-username"
>  #define CURL_BLOCK_OPT_PROXY_PASSWORD_SECRET "proxy-password-secret"

to something that is consistent but requires a mass-edit if we add a
longer name.


> @@ -235,7 +236,7 @@ static size_t curl_header_cb(void *ptr, size_t size, 
> size_t nmemb, void *opaque)
>  /* Called from curl_multi_do_locked, with s->mutex held.  */
>  static size_t curl_read_cb(void *ptr, size_t size, size_t nmemb, void 
> *opaque)
>  {
> -    CURLState *s = ((CURLState*)opaque);
> +    CURLState *s = ((CURLState *)opaque);

Umm, this is C, so why not just:

CURLState *s = opaque;

Those are minor findings, so whether or not you address them,
Reviewed-by: Eric Blake <address@hidden>

-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3266
Virtualization:  qemu.org | libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

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