|Re: [hatari-devel] Coding style|
[ Thread Index |
| More lists.tuxfamily.org/hatari-devel Archives
- To: hatari-devel@xxxxxxxxxxxxxxxxxxx
- Subject: Re: [hatari-devel] Coding style
- From: Thomas Huth <th.huth@xxxxxxxxx>
- Date: Sat, 2 May 2020 17:55:37 +0200
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.de; s=2017; t=1588434939; bh=XHolE0Mr4jPnvrZxDaFMM+8w/KsTPva8kIM6mdLpy5A=; h=Date:From:To:Subject:From; b=knEyDUMbK5EJHHp3qB9Saxg3JBo1DAxYOOQC56Rv3KthZcJcnvizkvzPNRsPFGr2H nVPe3hbXs2YAo1AFrLl98TmcBSov0jU47lC52901e48QOP3639ytxN0AELHaHruA/a dv4ZCTDeDOGxpBkwFvgX3+n6Q4AqkYNum+sszMV+j2YzyLnI2Wip0h+uDVS3TUkGAy owxzp9Ozq8lNubuQcMyv2Z/Ju7BZ0DvU0CmWPm/Sz/tEyZOarhNQ1gsi0puwoB71B0 9DFLD8qSL/c+O+8U3Sx7MMx2F9WogK/GMF04dCmMy7SeAaWnP7AdcWbY9m35oEmG7+ q3Ej43B0k6Utw==
Am Sat, 2 May 2020 18:02:26 +0300
schrieb Eero Tamminen <oak@xxxxxxxxxxxxxx>:
> Regarding this commit:
> commit 976e2238d24c413b76e2c2f0bb2937ee34dd5363
> Author: Thomas Huth <huth@xxxxxxxxxxxxx>
> Date: Sat May 2 09:23:52 2020 +0200
> Fix coding style in statusbar.c
> statusbar.c is not derived from another
> project, so we should use the main Hatari
> coding style here and put curly braces on
> new lines.
> It didn't fix anything.
It did. The style there was already inconsistent, see e.g.:
> Our coding style document:
> 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.
> Because our main upstream projects are WinUAE,
> Qemu and Aranym , and all of those use brace-
> on-same-line style, I'm proposing that we adopt
> that as the default style for rest of the Hatari
> code too, for consistency's sake.
Hmm, I guess 10 or 15 years ago, I'd screamed "heretic idea!" now, but
acutally, I've done quite a lot of QEMU and Linux kernel development in
my job in the past years, so I'm fine with both coding style nowadays
(I just dislike mixing the style in one file - that's really too
Nicolas, what's your opinion?
> If agreed, I can convert src/debug/*.c files to
> that convention as I'm nowadays doing most of
> maintenance for that code, and several of the
> files there already use brace-on-same-line style
There are also tools like "astyle" which can be used to do the change
> 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
It's been quite a while since we last exchanged some code ... but
for example, it seems that they use the brace-on-same-line style in new
>  Qemu uses brace-on-same-line, but different
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.