Re: [hatari-devel] Coding style

[ Thread Index | Date Index | More lists.tuxfamily.org/hatari-devel Archives ]


Hi,

On 5/2/20 6:55 PM, Thomas Huth wrote:
Am Sat, 2 May 2020 18:02:26 +0300
schrieb Eero Tamminen <oak@xxxxxxxxxxxxxx>:
[...]>> Our coding style document:
https://hatari.tuxfamily.org/doc/coding.txt

Says:
---------------------------
...
try to adapt to the coding style of the file that
you're currently editing.

- For new files, pick one of the existing coding
    styles, don't add a new one.

It still makes sense that you pick the coding style that is used in the
other files in the same folder, i.e. use the traditional coding style
in the src/ folder, use the WinUAE coding style in src/cpu/, etc.

As Nicolas agreed, maybe in that case we should
add Git commit hooks (after release) that enforce
these styles for the files in question?

(Preferably ask also Toni to do the same for
his project, so that we can adapt his settings,
to avoid our cpu/ folder settings changing
anything else than our own code changes.)


[...]
There are also tools like "astyle" which can be used to do the change
automatically.

Rest of the files could be converted later on, but
that needs input from Previous downstream project
in case it is still synching some code with
Hatari.

It's been quite a while since we last exchanged some code ... but
looking at
https://sourceforge.net/p/previous/code/HEAD/tree/trunk/src/scsi.c
for example, it seems that they use the brace-on-same-line style in new
files, too.

[5] Qemu uses brace-on-same-line, but different
indenting:
https://git.qemu.org/?p=qemu.git;a=blob_plain;f=CODING_STYLE.rst;hb=HEAD

The code that we've got from QEMU is mostly ide.c - which is completely
out of sync anway and has also mostly been turned into the base Hatari
coding style in the course of time, so I don't think that we have to
consider the QEMU-way of indenting with spaces instead of tabs.

Ok.


	- Eero



Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/