Thread (13 messages) flat view 13 messages, 7 authors, 2017-07-12

Re: [PATCH] strbuf: use designated initializers in STRBUF_INIT

From: Johannes Sixt <hidden>
Date: 2017-07-10 19:57:48

Am 10.07.2017 um 09:03 schrieb Jeff King:
On Sun, Jul 09, 2017 at 10:05:49AM -0700, Junio C Hamano wrote:
quoted
René Scharfe [off-list ref] writes:
quoted
I wonder when we can begin to target C99 in git's source, though. :)
Let's get the ball rolling...
Good to know that you do not resist moving to a more modern build 
environment.
quoted
by starting to use some of the useful
features like designated initializers,
It's a pity, though, that you do not suggest something even more useful, 
such as C++14.
Subject: [PATCH] strbuf: use designated initializers in STRBUF_INIT
-#define STRBUF_INIT  { 0, 0, strbuf_slopbuf }
+#define STRBUF_INIT  { .alloc = 0, .len = 0, .buf = strbuf_slopbuf }
While this may serve as a test balloon, changing STRBUF_INIT, or any of 
those _INIT macros, is actually the least interesting. The interesting 
instances are initializations for which we do *not* have a macro.

-- Hannes
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help