[FFmpeg-devel] [PATCH] remove useless extern keywords
Måns Rullgård
mans
Wed Dec 3 16:05:00 CET 2008
Diego Biurrun wrote:
> On Tue, Dec 02, 2008 at 01:32:36AM +0000, M?ns Rullg?rd wrote:
>> Diego Biurrun <diego at biurrun.de> writes:
>>
>> > In the nvidia patch review there were complaints about unnecessary
>> > extern keywords being added to the code. Since this was apparently a
>> > copy and paste issue from the xvmc code, I wondered why they were there
>> > in the first place.
>> >
>> > Here is a patch to get rid of them so no bad examples remain.
>>
>> I'll comment on the files I maintain.
>>
>> > --- libavcodec/alpha/simple_idct_alpha.c (revision 15974)
>> > +++ libavcodec/alpha/simple_idct_alpha.c (working copy)
>> > @@ -29,10 +29,10 @@
>> >
>> > -extern void (*put_pixels_clamped_axp_p)(const DCTELEM *block, uint8_t
>> *pixels,
>> > - int line_size);
>> > -extern void (*add_pixels_clamped_axp_p)(const DCTELEM *block, uint8_t
>> *pixels,
>> > - int line_size);
>> > +void (*put_pixels_clamped_axp_p)(const DCTELEM *block, uint8_t *pixels,
>> > + int line_size);
>> > +void (*add_pixels_clamped_axp_p)(const DCTELEM *block, uint8_t *pixels,
>> > + int line_size);
>>
>> Wrong. Those are function pointers.
>
> Thanks, good catch.
>
>> > --- libavcodec/sh4/dsputil_sh4.c (revision 15974)
>> > +++ libavcodec/sh4/dsputil_sh4.c (working copy)
>> > @@ -89,7 +89,7 @@
>> >
>> > -extern void dsputil_init_align(DSPContext* c, AVCodecContext *avctx);
>> > +void dsputil_init_align(DSPContext* c, AVCodecContext *avctx);
>> >
>> > void dsputil_init_sh4(DSPContext* c, AVCodecContext *avctx)
>> > {
>>
>> OK. No maintainer, but I seem to be the only one around here who
>> knows SH4. (Yes, those should have an ff_ prefix.)
>
> I'll add such a prefix after I commit this.
I'd rather do that myself since I can sort of test it.
>> > --- libavformat/mpegts.c (revision 15974)
>> > +++ libavformat/mpegts.c (working copy)
>> > @@ -38,8 +38,8 @@
>> >
>> > static PESContext* add_pes_stream(MpegTSContext *ts, int pid, int
pcr_pid, int stream_type);
>> > static AVStream* new_pes_av_stream(PESContext *pes, uint32_t code);
>> > -extern void av_set_program_name(AVProgram *program, char *provider_name,
char *name);
>> > -extern void av_program_add_stream_index(AVFormatContext *ac, int progid,
unsigned int idx);
>> > +void av_set_program_name(AVProgram *program, char *provider_name, char
*name);
>> > +void av_program_add_stream_index(AVFormatContext *ac, int progid,
unsigned int idx);
>>
>> Those declarations don't belong there at all. The definitions are in
>> utils.c. I don't know what the proper place would be. Michael?
>
> avformat.h? internal.h? Depends on whether these are supposed to be
> exported or not.
Exporting them makes no sense. They are only of use in a demuxer.
--
M?ns Rullg?rd
mans at mansr.com
More information about the ffmpeg-devel
mailing list