[FFmpeg-devel] [PATCH] Define cmdline_program_name and use it in show_help

Måns Rullgård mans
Tue Oct 28 17:12:38 CET 2008


Benoit Fouet wrote:
> Hi,
>
> Stefano Sabatini wrote:
>> Hi, as in subject.
>>
>> Usage message shown in show_help mimicks the commandline command to
>> issue, so program_name is not the right choice, and to use argv[0] is
>> nicer than use an hardcoded value.
>>
>> Regards.
>> --
>> FFmpeg = Fantastic and Funny Mythic Portentous Empowered Gadget
>>
>> ------------------------------------------------------------------------
>>
>> Index: ffmpeg.c
>> ===================================================================
>> --- ffmpeg.c	(revision 15712)
>> +++ ffmpeg.c	(working copy)
>> @@ -71,6 +71,7 @@
>>  #undef exit
>>
>>  const char program_name[] = "FFmpeg";
>> +const char* cmdline_program_name = NULL;
>>
>
> why is it not static ? btw, I'd prefer char *foo to char* foo, but maybe
> that's just me...

I too prefer char *foo, and for a simple reason.  Consider this declaration:

char *foo, bar;

This declares foo as a pointer to char and bar as a char.  Writing it as

char* foo, bar;

makes it look like the author thought both would be pointers.

-- 
M?ns Rullg?rd
mans at mansr.com




More information about the ffmpeg-devel mailing list