cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: CODE_STYLE

From: Gisle Vanem <gvanem_at_yahoo.no>
Date: Mon, 14 Mar 2016 13:40:05 +0100

Daniel Stenberg wrote:

> Yes! I would agree that your latter version is easier on the eye and thus a better way to express that code.
>
> Maybe expressed like this:
>
> "Please use space on both sides of operators in C expressions"

Agreed.

Speaking of "easier on the eye". Calling of func-pointers like:
  cb(user, el->ptr); (hash.c / 224).

is IMHO clearer if it was written like:
  (*cb)(user, el->ptr);

Hence, no need to lift the eyes up to the start to
understand what 'cb' is:
  Curl_hash_apply(curl_hash *h, void *user,
                  void (*cb)(void *user, void *ptr))

-- 
--gv
-------------------------------------------------------------------
List admin: https://cool.haxx.se/list/listinfo/curl-library
Etiquette:  https://curl.haxx.se/mail/etiquette.html
Received on 2016-03-14