Skip to content

Commit 67b28b5

Browse files
committed
Use correct destination type when casting enums
1 parent 6b96025 commit 67b28b5

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/property/types/CloudSchedule.h

+6-6
Original file line numberDiff line numberDiff line change
@@ -138,8 +138,8 @@ class Schedule {
138138
}
139139

140140
static unsigned int createFixedDeltaScheduleConfiguration(ScheduleUnit unit, unsigned int delta) {
141-
unsigned int temp_unit = static_cast<int>(unit);
142-
unsigned int temp_type = static_cast<int>(ScheduleType::FixedDelta);
141+
int temp_unit = static_cast<int>(unit);
142+
int temp_type = static_cast<int>(ScheduleType::FixedDelta);
143143
unsigned int temp_delta = delta;
144144

145145
if (temp_delta > SCHEDULE_REP_MASK) {
@@ -150,7 +150,7 @@ class Schedule {
150150

151151
static unsigned int createWeeklyScheduleConfiguration(ScheduleWeeklyMask weekMask) {
152152
unsigned int temp_week = 0;
153-
unsigned int temp_type = static_cast<int>(ScheduleType::Weekly);
153+
int temp_type = static_cast<int>(ScheduleType::Weekly);
154154

155155
for(int i = 0; i<7; i++) {
156156
if(weekMask[static_cast<ScheduleWeekDay>(i)] == ScheduleState::Active) {
@@ -162,7 +162,7 @@ class Schedule {
162162

163163
static unsigned int createMonthlyScheduleConfiguration(int dayOfTheMonth) {
164164
int temp_day = dayOfTheMonth;
165-
unsigned int temp_type = static_cast<int>(ScheduleType::Monthly);
165+
int temp_type = static_cast<int>(ScheduleType::Monthly);
166166

167167
if(temp_day < 1) {
168168
temp_day = 1;
@@ -175,9 +175,9 @@ class Schedule {
175175
}
176176

177177
static unsigned int createYearlyScheduleConfiguration(ScheduleMonth month, int dayOfTheMonth) {
178-
int temp_day = createMonthlyScheduleConfiguration(dayOfTheMonth);
178+
unsigned int temp_day = createMonthlyScheduleConfiguration(dayOfTheMonth);
179179
int temp_month = static_cast<int>(month);
180-
unsigned int temp_type = static_cast<int>(ScheduleType::Yearly);
180+
int temp_type = static_cast<int>(ScheduleType::Yearly);
181181

182182
return (temp_type << SCHEDULE_TYPE_SHIFT) | (temp_month << SCHEDULE_MONTH_SHIFT)| temp_day;
183183
}

0 commit comments

Comments
 (0)