[GRASS-dev] GNU indent is confused by dglib macro code

Vaclav Petras wenzeslaus at gmail.com
Mon Nov 14 19:42:29 PST 2022


Dear all,

GNU indent is confused by code in dglib/misc-template.c and I can't really
blame it. I'm confused, too. It is hard to track the structure there.

indent says (also reported in #1630):

indent: ./lib/vector/dglib/misc-template.c:574: Error:Stmt nesting error.
indent: ./lib/vector/dglib/misc-template.c:655: Error:Unmatched 'else'
indent: ./lib/vector/dglib/misc-template.c:684: Error:Stmt nesting error.

All three seem to be connected to the two uses of DGL_FOREACH_EDGE which
are also the only two uses of this macro. There is also plenty of
ifdef-else-endif which might be confusing indent.

Any opinions on how to proceed here? I would like to see the code
simplified in the sense that it is easily readable by both humans and
machines, but it is not clear to me how to achieve it here.

The misc-template.c is included into "v1" and "v2" file to produce
different code through the ifdefs for DGlib graph versions 1 and 2.

Best,
Vaclav

[#1630] https://github.com/OSGeo/grass/issues/1630#issuecomment-1295442400
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/grass-dev/attachments/20221114/23bbd553/attachment.htm>


More information about the grass-dev mailing list