Re: [Spice-devel] [PATCH v2 05/13] Rephrase section about constants

2018-02-14 Thread Christophe Fergeau
On Thu, Feb 08, 2018 at 03:48:46AM -0500, Frediano Ziglio wrote: > I think that the "Alternatively, use global `const` variables." > is quite an ancient comment when spice-server was in C++ > (much before I join and I think even older than the git repository!) There was a C++ *client* in spice.git

Re: [Spice-devel] [PATCH v2 05/13] Rephrase section about constants

2018-02-08 Thread Christophe de Dinechin
> On 8 Feb 2018, at 09:48, Frediano Ziglio wrote: > >> >> From: Christophe de Dinechin >> >> The indent of the rephrasing is that: >> >> - If you have a single constant, use const, e.g. (visible in debugger) >>const unsigned max_stuff = 42; >> >> - If you have multiple constants, prefe

Re: [Spice-devel] [PATCH v2 05/13] Rephrase section about constants

2018-02-08 Thread Frediano Ziglio
> > From: Christophe de Dinechin > > The indent of the rephrasing is that: > > - If you have a single constant, use const, e.g. (visible in debugger) > const unsigned max_stuff = 42; > > - If you have multiple constants, prefer enums over #define, as > already suggested later in the gu

[Spice-devel] [PATCH v2 05/13] Rephrase section about constants

2018-02-07 Thread Christophe de Dinechin
From: Christophe de Dinechin The indent of the rephrasing is that: - If you have a single constant, use const, e.g. (visible in debugger) const unsigned max_stuff = 42; - If you have multiple constants, prefer enums over #define, as already suggested later in the guide: enum {