What coding style is preferred if I want to merge the lzma code into LinuxBIOS?
* plain code, as found in upstream sources (a mess) * all unneeded #ifdef sections removed * additionally proper indentation (tab=8) * additionally replaced obfuscated #defines * additionally Lindented to Linux kernel style
Also, what types should I use for variables? * u8, u16, u32 * UInt8, UInt16, UInt32 * u_int8_t ... * u_int8 ... * uint8 ... * uint8_t ... * unsigned char, unsigned short, unsigned int
Regards, Carl-Daniel
Carl-Daniel Hailfinger wrote:
What coding style is preferred if I want to merge the lzma code into LinuxBIOS?
- plain code, as found in upstream sources (a mess)
- all unneeded #ifdef sections removed
- additionally proper indentation (tab=8)
- additionally replaced obfuscated #defines
- additionally Lindented to Linux kernel style
linux-c-mode, so yeah, lindent.
Also, what types should I use for variables?
- u8, u16, u32
- UInt8, UInt16, UInt32
- u_int8_t ...
- u_int8 ...
- uint8 ...
- uint8_t ...
- unsigned char, unsigned short, unsigned int
that's a mess in linuxbios right now. Stefan, you have a preference?
ron
uint8_t, uint16_t, uint32_t, uint64_t
YH
On 5/25/06, Ronald G Minnich rminnich@lanl.gov wrote:
Carl-Daniel Hailfinger wrote:
What coding style is preferred if I want to merge the lzma code into LinuxBIOS?
- plain code, as found in upstream sources (a mess)
- all unneeded #ifdef sections removed
- additionally proper indentation (tab=8)
- additionally replaced obfuscated #defines
- additionally Lindented to Linux kernel style
linux-c-mode, so yeah, lindent.
Also, what types should I use for variables?
- u8, u16, u32
- UInt8, UInt16, UInt32
- u_int8_t ...
- u_int8 ...
- uint8 ...
- uint8_t ...
- unsigned char, unsigned short, unsigned int
that's a mess in linuxbios right now. Stefan, you have a preference?
ron
-- linuxbios mailing list linuxbios@linuxbios.org http://www.openbios.org/mailman/listinfo/linuxbios
* Ronald G Minnich rminnich@lanl.gov [060526 01:50]:
Carl-Daniel Hailfinger wrote:
What coding style is preferred if I want to merge the lzma code into LinuxBIOS?
- plain code, as found in upstream sources (a mess)
Please don't. Except it is a part that must be updated frequently. (x86emu would have been such an example)
- all unneeded #ifdef sections removed
definitely. This is becoming an issue. We have some code paths that are not fundamentally different but still cause the code to be hard to read. CONFIG_USE_INIT for example.
- additionally proper indentation (tab=8)
Yes, too deep code should hurt the eye and make the reader factor it.
- additionally Lindented to Linux kernel style
linux-c-mode, so yeah, lindent.
basically indent -kr -i8
Also, what types should I use for variables?
- uint8_t ...
that's a mess in linuxbios right now. Stefan, you have a preference?
* uint8_t ... for types. The exception from the rule is romcc code which is said to be worse if you use types other than "unsigned" and "signed" (which should be fixed in the compiler, not in the code)