Hi Daniel,
On Tue, Mar 11, 2014 at 11:26 PM, Daniel Willmann <dwillmann(a)sysmocom.de> wrote:
On Fri, 2014-03-07 at 20:11, Alexander Chemeris
wrote:
-unsigned long gsm340_validity_period(uint8_t
sms_vpf, uint8_t *sms_vp)
+time_t gsm340_validity_period(time_t now, uint8_t sms_vpf, uint8_t *sms_vp)
{
uint8_t fi; /* functionality indicator */
switch (sms_vpf) {
case GSM340_TP_VPF_RELATIVE:
- return gsm340_vp_relative(sms_vp);
+ return gsm340_vp_relative(now, sms_vp);
You could also omit now in all the static function and return now +
func() in gsm340_validity_period().
That looks slightly cleaner to me and shouldn't change testability.
I made it this way to follow a principle of least surprise - you know,
that you always get absolute time as a return value and you don't even
need to think about this. But that said, this is a minor issue to me,
so I've changed it.
All other comments are proper and are also fixed in the attached patch
and in the branch (achemeris/sms-validity).
--
Regards,
Alexander Chemeris.
CEO, Fairwaves, Inc. / ООО УмРадио
https://fairwaves.co