Re: [chrony-dev] [PATCH] ntp_core.c: Remove useless assignment `prev = inst->local_rx;`

[ Thread Index | Date Index | More chrony.tuxfamily.org/chrony-dev Archives ]


On Thu, Oct 03, 2013 at 03:03:09PM +0200, Paul Menzel wrote:
> Am Donnerstag, den 03.10.2013, 14:48 +0200 schrieb Miroslav Lichvar:
> > --- a/ntp_core.c
> > +++ b/ntp_core.c
> > @@ -1548,6 +1548,8 @@ NCR_SlewTimes(NCR_Instance inst, struct timeval *when, double dfreq, double doff
> >  #ifdef TRACEON
> >    LOG(LOGS_INFO, LOGF_NtpCore, "rx prev=[%s] new=[%s]",
> >        UTI_TimevalToString(&prev), UTI_TimevalToString(&inst->local_rx));
> > +#else
> > +  (void)prev;
> >  #endif
> >    prev = inst->local_tx;
> >    if (inst->local_tx.tv_sec || inst->local_tx.tv_usec)
> 
> Correct, this patch addresses the warning. It’s pretty ugly though just
> for appeasing code checkers/analyzers. ;-) But on the other hand, it is
> used in the code already. Besides including these assignments into if
> statements I was not able to come up with a better solution either.

Ok, thanks. I'll make that change.

Maybe we could introduce an IFTRACEON/IFTRACEOFF macros to avoid the
ugly #ifdef wrapping.

-- 
Miroslav Lichvar

--
To unsubscribe email chrony-dev-request@xxxxxxxxxxxxxxxxxxxx with "unsubscribe" in the subject.
For help email chrony-dev-request@xxxxxxxxxxxxxxxxxxxx with "help" in the subject.
Trouble?  Email listmaster@xxxxxxxxxxxxxxxxxxxx.


Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/