From: Maxim Mamontov Date: Wed, 9 Dec 2015 20:21:07 +0000 (+0200) Subject: Correct conversion of resetable structures. X-Git-Url: https://git.stg.codes/stg.git/commitdiff_plain/ce4f87b0803d81e413699ffe65d5dbf4eec9d64c?ds=sidebyside;hp=-c Correct conversion of resetable structures. --- ce4f87b0803d81e413699ffe65d5dbf4eec9d64c diff --git a/include/stg/tariff_conf.h b/include/stg/tariff_conf.h index ae40c128..fe94b6e5 100644 --- a/include/stg/tariff_conf.h +++ b/include/stg/tariff_conf.h @@ -98,18 +98,17 @@ struct DIRPRICE_DATA_RES DIRPRICE_DATA GetData() const { DIRPRICE_DATA dd; - dd.hDay = hDay.data(); - dd.hNight = hNight.data(); - dd.mDay = mDay.data(); - dd.mNight = mNight.data(); - dd.noDiscount = noDiscount.data(); - dd.priceDayA = priceDayA.data(); - dd.priceDayB = priceDayB.data(); - - dd.priceNightA = priceNightA.data(); - dd.priceNightB = priceNightB.data(); - dd.singlePrice = singlePrice.data(); - dd.threshold = threshold.data(); + hDay.maybeSet(dd.hDay); + hNight.maybeSet(dd.hNight); + mDay.maybeSet(dd.mDay); + mNight.maybeSet(dd.mNight); + noDiscount.maybeSet(dd.noDiscount); + priceDayA.maybeSet(dd.priceDayA); + priceDayB.maybeSet(dd.priceDayB); + priceNightA.maybeSet(dd.priceNightA); + priceNightB.maybeSet(dd.priceNightB); + singlePrice.maybeSet(dd.singlePrice); + threshold.maybeSet(dd.threshold); return dd; } @@ -194,12 +193,12 @@ struct TARIFF_CONF_RES TARIFF_CONF GetData() const { TARIFF_CONF tc; - tc.fee = fee.data(); - tc.free = free.data(); - tc.name = name.data(); - tc.passiveCost = passiveCost.data(); - tc.traffType = traffType.data(); - tc.period = period.data(); + fee.maybeSet(tc.fee); + free.maybeSet(tc.free); + name.maybeSet(tc.name); + passiveCost.maybeSet(tc.passiveCost); + traffType.maybeSet(tc.traffType); + period.maybeSet(tc.period); return tc; }