From 86c703629d8d70434b7d9cc642578f70a78818bc Mon Sep 17 00:00:00 2001 From: Matt Spinler Date: Mon, 2 Dec 2019 15:37:21 -0600 Subject: PEL: Add constructors to BCDTime Add constructors to set all members to zero initially or pass them all in. Signed-off-by: Matt Spinler Change-Id: Ic28cee19014c739f331fd0498229dfb503b0df88 --- extensions/openpower-pels/bcd_time.hpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'extensions') diff --git a/extensions/openpower-pels/bcd_time.hpp b/extensions/openpower-pels/bcd_time.hpp index 72c5755..3a805a5 100644 --- a/extensions/openpower-pels/bcd_time.hpp +++ b/extensions/openpower-pels/bcd_time.hpp @@ -22,6 +22,21 @@ struct BCDTime uint8_t seconds; uint8_t hundredths; + BCDTime() : + yearMSB(0), yearLSB(0), month(0), day(0), hour(0), minutes(0), + seconds(0), hundredths(0) + { + } + + BCDTime(uint8_t yearMSB, uint8_t yearLSB, uint8_t month, uint8_t day, + uint8_t hour, uint8_t minutes, uint8_t seconds, + uint8_t hundredths) : + yearMSB(yearMSB), + yearLSB(yearLSB), month(month), day(day), hour(hour), minutes(minutes), + seconds(seconds), hundredths(hundredths) + { + } + bool operator==(const BCDTime& right) const; bool operator!=(const BCDTime& right) const; -- cgit v1.2.1