On Freitag, 21. August 2020 02:04:52 CEST Barry Jackson wrote:
> Hello,
> Quick question:
> 
> https://svn.linuxsampler.org/cgi-bin/viewvc.cgi/linuxsampler/trunk/src/netwo
> rk/lscp.y?r1=3054&r2=3787&pathrev=3787
> 
> I am not a programmer but I do maintain the Linuxsampler package for Mageia.
> 
> To me the above code looks as though there may be a typo in it?
> 
> Is the space after # on line 1486 correct?

It is correct, both in C as well as in C++. A preprocessor statement must 
start with a '#' character at the start of the line, but it is not mandatory 
for the actual preprocessor statement to follow that '#' character 
immediately.

Space indents like this one are commonly used to clearly structure nested 
preprocessor statement blocks, i.e.

#if foo
# if bla
#   define something 0
# else
#   define something 1
# endif
#else
# if bla
#   define something 2
# else
#   define something 3
# endif
#endif

is better for the eye than:

#if foo
#if bla
#define something 0
#else
#define something 1
#endif
#else
#if bla
#define something 2
#else
#define something 3
#endif
#endif

This comes especially handy if somebody accidentally breaks the structure when 
the software evolves. The indents allow to recover the structure easily.

CU
Christian




_______________________________________________
Linuxsampler-devel mailing list
Linuxsampler-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxsampler-devel

Reply via email to