[vlc-devel] [PATCH] messages: rename vlc_LogSwitch methods
Alexandre Janniaux
ajanni at videolabs.io
Wed Dec 23 12:11:20 UTC 2020
Hi,
On Wed, Dec 23, 2020 at 01:24:55PM +0200, Rémi Denis-Courmont wrote:
> Le keskiviikkona 23. joulukuuta 2020, 13.06.44 EET Alexandre Janniaux a écrit
> :
> > vlc_vaLogSwitch is confusing given that vlc_LogSwitch also exists in the
> > public API. Using usual prefix notation avoid the confusion.
>
> I have to disagree. This is consistent with the existing (public and private)
> logging function names and I don't see what confusing here. And given that the
> functions are static, this looks totally gratuitious.
The point is that it's static, but unrelated to vlc_LogSwitch
function, and it looks like the va* variant of vlc_LogSwitch
which doesn't make sense.
That's not a hard issue, but we usually provide a object_Action
naming, as you mentioned multiple time on this mailing list,
and this helps solving this confusion at the same time. :)
Regards,
--
Alexandre Janniaux
Videolabs
> > ---
> > src/misc/messages.c | 8 ++++----
> > 1 file changed, 4 insertions(+), 4 deletions(-)
> >
> > diff --git a/src/misc/messages.c b/src/misc/messages.c
> > index b7dc1d8f50..0b4f2f9efb 100644
> > --- a/src/misc/messages.c
> > +++ b/src/misc/messages.c
> > @@ -304,7 +304,7 @@ struct vlc_logger_switch {
> > vlc_rwlock_t lock;
> > };
> >
> > -static void vlc_vaLogSwitch(void *d, int type, const vlc_log_t *item,
> > +static void vlc_logswitch_vaLog(void *d, int type, const vlc_log_t *item,
> > const char *format, va_list ap)
> > {
> > struct vlc_logger *logger = d;
> > @@ -318,7 +318,7 @@ static void vlc_vaLogSwitch(void *d, int type, const
> > vlc_log_t *item, vlc_rwlock_unlock(&logswitch->lock);
> > }
> >
> > -static void vlc_LogSwitchClose(void *d)
> > +static void vlc_logswitch_Close(void *d)
> > {
> > struct vlc_logger *logger = d;
> > struct vlc_logger_switch *logswitch =
> > @@ -333,8 +333,8 @@ static void vlc_LogSwitchClose(void *d)
> > }
> >
> > static const struct vlc_logger_operations switch_ops = {
> > - vlc_vaLogSwitch,
> > - vlc_LogSwitchClose,
> > + vlc_logswitch_vaLog,
> > + vlc_logswitch_Close,
> > };
> >
> > static void vlc_LogSwitch(vlc_logger_t *logger, vlc_logger_t *new_logger)
>
>
> --
> Реми Дёни-Курмон
> http://www.remlab.net/
>
>
>
> _______________________________________________
> vlc-devel mailing list
> To unsubscribe or modify your subscription options:
> https://mailman.videolan.org/listinfo/vlc-devel
More information about the vlc-devel
mailing list