]> rtime.felk.cvut.cz Git - frescor/ffmpeg.git/commitdiff
Update coding rules.
authormellum <mellum@9553f0bf-9b14-0410-a0b8-cfaf0461ba5b>
Tue, 23 Mar 2004 07:17:14 +0000 (07:17 +0000)
committermellum <mellum@9553f0bf-9b14-0410-a0b8-cfaf0461ba5b>
Tue, 23 Mar 2004 07:17:14 +0000 (07:17 +0000)
git-svn-id: file:///var/local/repositories/ffmpeg/trunk@2920 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b

doc/ffmpeg-doc.texi

index 88610784c55e855566223f857ad65555c5c8310b..cae8250e0db14251069f3bf5042f79ae2d349c9a 100644 (file)
@@ -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