aboutsummaryrefslogtreecommitdiffstats
path: root/Game/Code/lib/ffmpeg/avformat.pas
diff options
context:
space:
mode:
authortobigun <tobigun@b956fd51-792f-4845-bead-9b4dfca2ff2c>2008-06-14 18:24:43 +0000
committertobigun <tobigun@b956fd51-792f-4845-bead-9b4dfca2ff2c>2008-06-14 18:24:43 +0000
commit68b29a08bc21b15b923b3430fbc41baedba73883 (patch)
tree23005644b6e4ec95914fd9e51c23735715f1ec5f /Game/Code/lib/ffmpeg/avformat.pas
parentbcec80f4bc1a7b299f37b49d463494d6817f4496 (diff)
downloadusdx-68b29a08bc21b15b923b3430fbc41baedba73883.tar.gz
usdx-68b29a08bc21b15b923b3430fbc41baedba73883.tar.xz
usdx-68b29a08bc21b15b923b3430fbc41baedba73883.zip
Removed some "const" parameter modifiers for external function declarations. Pascal has no equivalent to C's "pointer to constant type" const modifier. E.g. "const char* cstr" is not equivalent to "const cstr: PChar". This is because the first is a variable pointer to a constant type and the latter is a constant pointer to a variable type. This means contrary to the C version, in the incorrect pascal version the string can be changed. So it is like a false friend in this example, although "cstr: PChar" is not correct either, as the string can be changed too.
Also note that "var myvar: TMyType" is always passed as reference (a pointer is used for this, so it is equivalent to "myvar: PMyType"). This also normally applies to "const myvar: TMyType". But not if the type-size is < 4byte or the function is declared as stdcall or cdecl. In these cases the variable is passed on the stack and not as a pointer. So NEVER replace a C declaration "const my_type_t* my_var" with "const my_var: TMy_type" as it might fail. Use the var modifier instead. git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@1148 b956fd51-792f-4845-bead-9b4dfca2ff2c
Diffstat (limited to 'Game/Code/lib/ffmpeg/avformat.pas')
-rw-r--r--Game/Code/lib/ffmpeg/avformat.pas2
1 files changed, 1 insertions, 1 deletions
diff --git a/Game/Code/lib/ffmpeg/avformat.pas b/Game/Code/lib/ffmpeg/avformat.pas
index 4095ddc6..730a64e4 100644
--- a/Game/Code/lib/ffmpeg/avformat.pas
+++ b/Game/Code/lib/ffmpeg/avformat.pas
@@ -744,7 +744,7 @@ function av_oformat_next(f: PAVOutputFormat): PAVOutputFormat;
cdecl; external av__format;
{$IFEND}
-function av_guess_image2_codec({const} filename: PChar): TCodecID;
+function av_guess_image2_codec(filename: {const} PChar): TCodecID;
cdecl; external av__format;
(* XXX: use automatic init with either ELF sections or C file parser *)