I think they are useful. I have done several changes like this in the past. It allows the
Compiler to optimize better and will also prevent unintended modifications which can lead
to bugs
________________________________
From: sr-dev <sr-dev-bounces(a)lists.kamailio.org> on behalf of liviu-rolo
<notifications(a)github.com>
Sent: Friday, May 20, 2022 2:57:59 PM
To: Kamailio Devel List <sr-dev(a)lists.sip-router.org>
Cc: Subscribed <subscribed(a)noreply.github.com>
Subject: Re: [sr-dev] [kamailio/kamailio] core: const correctness (PR #3120)
They are not necessary.
In fact, I needed const only in init_dst_from_rcv for an internal module, but, with the
occasion, I added more const for consistency - including existing code like su_cmp and
su_getport.
So, apart from consistency and style, they are neither useful for the community, I guess.
—
Reply to this email directly, view it on
GitHub<https://github.com/kamailio/kamailio/pull/3120#issuecomment-11328…93>, or
unsubscribe<https://github.com/notifications/unsubscribe-auth/ABO7UZL2DC…NA>.
You are receiving this because you are subscribed to this thread.Message ID:
<kamailio/kamailio/pull/3120/c1132815693(a)github.com>