[FFmpeg-devel] [PATCH 1/4] lavu/float_dsp: add double-precision scalar product

Rémi Denis-Courmont remi at remlab.net
Sun Jun 2 13:30:50 EEST 2024


Le sunnuntaina 2. kesäkuuta 2024, 13.04.05 EEST Alexander Strasser via ffmpeg-
devel a écrit :
> On 2024-05-29 18:51 +0300, Rémi Denis-Courmont wrote:
> > Le keskiviikkona 29. toukokuuta 2024, 18.44.13 EEST Andreas Rheinhardt a
> > écrit> 
> > > > +static double ff_scalarproduct_double_c(const double *v1,
> > > 
> > > Don't use an ff_ prefix for a static function.
> > 
> > I can see over 300 such identifiers in the code base (many but not all
> > inline), and I don't see why that would be a problem.
> 
> I agree that it's not a problem regarding on the functional side,
> OTOH regarding coding conventions we try to consistently follow it's
> misleading as the ff_ prefix indicates a bigger scope of sharing.

Anybody can see the 'static' qualifier literally in front to see the function 
is not in a bigger scope of sharing. And if you do somehow miss and try to use 
the function, you will get a linker error.

The only case where this *actually* matters is in debugging. And exactly then 
it is much better to use the ff_ prefix *because* all symbols, including local 
ones like this, end up sharing the namespace.

> I think Andreas remark is correct and it would be better to not use ff_
> prefix wrongly when adding new code.

IMO, it is worse.

-- 
雷米‧德尼-库尔蒙
http://www.remlab.net/





More information about the ffmpeg-devel mailing list