1 |
---------------------------------------------------------------------- |
CodingStyle |
2 |
XviD Core coding style |
=========== |
|
|
|
|
Inspired by the Linux Kernel Coding Style |
|
|
|
|
|
---------------------------------------------------------------------- |
|
|
$Id: CodingStyle,v 1.2 2002-06-12 21:23:49 edgomez Exp $ |
|
3 |
|
|
4 |
|
|
5 |
This is a short document describing the preferred coding style for the |
This is a short document describing the preferred coding style for the |
54 |
|
|
55 |
struct foo_t |
struct foo_t |
56 |
{ |
{ |
57 |
body of the strcuture |
body of the structure |
58 |
} |
} |
59 |
|
|
60 |
Note that the closing brace is empty on a line of its own, _except_ in |
Note that the closing brace is empty on a line of its own, _except_ in |
72 |
.. |
.. |
73 |
} else if (x > y) { |
} else if (x > y) { |
74 |
... |
... |
75 |
} |
} else { |
|
else { |
|
76 |
.... |
.... |
77 |
} |
} |
78 |
|
|
263 |
|
|
264 |
The code _must_ be portable. Don't use specific functions to a |
The code _must_ be portable. Don't use specific functions to a |
265 |
compiler/OS/libC. Don't use specific compiler pragmas, or syntax |
compiler/OS/libC. Don't use specific compiler pragmas, or syntax |
266 |
extensions. |
extensions. The code _must_ be ANSI C compliant to ease portability |
267 |
|
on exotic platforms with only ANSI C compilers, much more widespread |
268 |
|
than ISO C99 compilers. |
269 |
|
|
270 |
Btw, if you have to use those deprecated/not portable features, then |
Btw, if you have to use those deprecated/not portable features, then |
271 |
use the src/portab.h to write a wrapper for each targeted system. |
use the src/portab.h to write a wrapper for each targeted system. |
273 |
For the moment, the supported platforms are : |
For the moment, the supported platforms are : |
274 |
- Win32 family (x86) with VC++ |
- Win32 family (x86) with VC++ |
275 |
- Cygwin env (bypassing the cygwin.dll with -mno-cygwin flag) |
- Cygwin env (bypassing the cygwin.dll with -mno-cygwin flag) |
276 |
- Mingw ??? |
- Mingw + Minsys |
277 |
- GNU/Linux (x86 and ppc for optimized code, or any other arch for |
- GNU/Linux (x86 and ppc for optimized code, or any other arch for |
278 |
the pure C version of the library) |
the pure C version of the library) |
279 |
- *BSD (same archs as GNU/Linux) |
- *BSD (same archs as GNU/Linux) |
280 |
|
- Solaris. |
281 |
|
|
282 |
|
Last edited: $Date: 2004-03-22 22:36:23 $ |