xboard-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [XBoard-devel] coding style


From: Byrial Jensen
Subject: Re: [XBoard-devel] coding style
Date: Fri, 23 Dec 2011 11:42:24 +0100
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.23) Gecko/20110922 Thunderbird/3.1.15

Den 23-12-2011 03:58, Arun Persaud skrev:
Hi

how about running "indent -gnu" across all source files and then add a
pre-commit git hook to make sure that it stays that way?

Well, I would in my opinion make the sources easier to read, but I don't have strong feelings about this.

Another thing I could suggest if everything is reformated anyway is to get rid of the traditional C style for functions. So instead of

int MyFunc(a, b, c)
        char a, b
        int c
{
  ...

use

int MyFunc(char a, char b, int c)
{
  ...

I don't know if any compilers anymore is dependent of the traditional style, I certainly don't know any that is.

But if they exist, they already for some time haven't been able to compile xboard anyway because there already is a few uses around of the new style (e.g. ics_printf() in backend.c).

Another "new" thing I had like to use, is the const qualifier. It can help finding bugs, and it allows for more aggresive optimisation.

Regards
- Byrial



reply via email to

[Prev in Thread] Current Thread [Next in Thread]