Given the number of people that are starting to be involved in Syslinux development, I wanted to start a discussion about a common coding style, for C code in particular. Currently, a lot of the code in Syslinux is written in different styles, partly because my own style has changed over the years. There are pretty much two alternatives that I think are realistic: a) Linux kernel coding style: http://tinyurl.com/kernelstyle b) Same as the Linux kernel style, but with 4 spaces instead of 8. Although I like Linus' style in most parts, I do think 8 spaces is somewhat excessive. This is the style we use for the Netwide Assembler, NASM. I would like to do one "flag day" cutover of all the code, so I would appreciate your input. -hpa -- H. Peter Anvin, Intel Open Source Technology Center I work for Intel. I don't speak on their behalf.
I'd highly agree with four spaces versus eight! Will have to review the coding style link you sent for the rest. Ironing out a consistent style seems nice... For some of the formatting, I'm sure there're automated tools, but if you'd like to go insofar as renaming variables and functions to conform to a standard, I would gather that you'd like a hand tackling the workload for a cut-over. Happy to help, there. - Shao -----Original Message----- From: H. Peter Anvin [mailto:hpa at zytor.com] Sent: Sunday, May 24, 2009 18:24 To: SYSLINUX Mailing list Cc: liu Aleaxander; claudiu.bogdan.mihail at gmail.com; Erwan Velu; Pierre-Alexander Meyer; Gene Cumm; Sebastian Herbszt; Miller, Shao Subject: Time to set a coding style for Syslinux? Given the number of people that are starting to be involved in Syslinux development, I wanted to start a discussion about a common coding style, for C code in particular. Currently, a lot of the code in Syslinux is written in different styles, partly because my own style has changed over the years. There are pretty much two alternatives that I think are realistic: a) Linux kernel coding style: http://tinyurl.com/kernelstyle b) Same as the Linux kernel style, but with 4 spaces instead of 8. Although I like Linus' style in most parts, I do think 8 spaces is somewhat excessive. This is the style we use for the Netwide Assembler, NASM. I would like to do one "flag day" cutover of all the code, so I would appreciate your input. -hpa -- H. Peter Anvin, Intel Open Source Technology Center I work for Intel. I don't speak on their behalf.
Pierre-Alexandre Meyer
2009-May-25 04:33 UTC
[syslinux] Time to set a coding style for Syslinux?
On Sunday 24 May 2009 ? 03:24:00PM, H. Peter Anvin wrote:> Given the number of people that are starting to be involved in Syslinux > development, I wanted to start a discussion about a common coding style, > for C code in particular.Great!> There are pretty much two alternatives that I think are realistic: > > a) Linux kernel coding style: > > http://tinyurl.com/kernelstyle > > b) Same as the Linux kernel style, but with 4 spaces instead of 8. > Although I like Linus' style in most parts, I do think 8 spaces is > somewhat excessive. > > This is the style we use for the Netwide Assembler, NASM.4 sounds good. FWIW We have roughly been following the kernel style with Erwan for HDT (we still are not consistent for tabs vs spaces yet though). -- Pierre-Alexandre Meyer
Sebastian Herbszt
2009-May-26 19:36 UTC
[syslinux] Time to set a coding style for Syslinux?
H. Peter Anvin wrote:> Given the number of people that are starting to be involved in Syslinux > development, I wanted to start a discussion about a common coding style, > for C code in particular. > > Currently, a lot of the code in Syslinux is written in different styles, > partly because my own style has changed over the years. > > There are pretty much two alternatives that I think are realistic: > > a) Linux kernel coding style: > > http://tinyurl.com/kernelstyle > > b) Same as the Linux kernel style, but with 4 spaces instead of 8. > Although I like Linus' style in most parts, I do think 8 spaces is > somewhat excessive. > > This is the style we use for the Netwide Assembler, NASM. > > I would like to do one "flag day" cutover of all the code, so I would > appreciate your input. > > -hpaWhat about the assembly code? Any style recommendations? - Sebastian