diff options
author | Falk Hüffner <mellum@users.sourceforge.net> | 2004-03-23 07:17:14 +0000 |
---|---|---|
committer | Falk Hüffner <mellum@users.sourceforge.net> | 2004-03-23 07:17:14 +0000 |
commit | cb6e87c15ac448a64a41871d58ebb7aa88da183e (patch) | |
tree | 2916f05be164c7440be3e4ea5b616a9b5522baf1 /doc | |
parent | 8066e59fa4f1a476262c6b3096f079ea5b582cb6 (diff) | |
download | ffmpeg-cb6e87c15ac448a64a41871d58ebb7aa88da183e.tar.gz |
Update coding rules.
Originally committed as revision 2920 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'doc')
-rw-r--r-- | doc/ffmpeg-doc.texi | 35 |
1 files changed, 33 insertions, 2 deletions
diff --git a/doc/ffmpeg-doc.texi b/doc/ffmpeg-doc.texi index 88610784c5..cae8250e0d 100644 --- a/doc/ffmpeg-doc.texi +++ b/doc/ffmpeg-doc.texi @@ -925,9 +925,40 @@ to send your patches to the ffmpeg mailing list. @section Coding Rules -ffmpeg is programmed in ANSI C language. GCC extensions are -tolerated. Indent size is 4. The TAB character should not be used. +ffmpeg is programmed in the ISO C90 language with a few additional +features from ISO C99, namely: +@itemize @bullet +@item +the @samp{inline} keyword; +@item +@samp{//} comments; +@item +designated struct initializers (@samp{struct s x = @{ .i = 17 @};}) +@item +compound literals (@samp{x = (struct s) { 17, 23 @};}) +@end itemize + +These features are supported by all compilers we care about, so we won't +accept patches to remove their use unless they absolutely don't impair +clarity and performance. + +All code must compile with gcc 2.95 and gcc 3.3. Currently, ffmpeg also +compiles with several other compilers, such as the Compaq ccc compiler +or Sun Studio 9, and we would like to keep it that way unless it would +be exceedingly involved. To ensure compatibility, please don't use any +additional C99 features or gcc extensions. Watch out especially for: +@itemize @bullet +@item +mixing statements and declarations; +@item +@samp{long long} (use @samp{int64_t} instead); +@item +@samp{__attribute__} not protected by @samp{#ifdef __GNUC__} or similar; +@item +gcc statement expressions (@samp{(x = (@{ int y = 4; y; @})}). +@end itemize +Indent size is 4. The TAB character should not be used. The presentation is the one specified by 'indent -i4 -kr'. Main priority in ffmpeg is simplicity and small code size (=less |