// --- The cache --
// cache of months
-static UMutex astroLock = U_MUTEX_INITIALIZER; // pod bay door lock
static icu::CalendarCache *gMonthCache = NULL;
static icu::CalendarAstronomer *gIslamicCalendarAstro = NULL;
sType = "islamic-umalqura";
break;
default:
- U_ASSERT(false); // out of range
- sType = "islamic"; // "islamic" is used as the generic type
- break;
+ UPRV_UNREACHABLE; // out of range
}
return sType;
}
{
double age = 0;
- umtx_lock(&astroLock);
+ static UMutex *astroLock = STATIC_NEW(UMutex); // pod bay door lock
+ umtx_lock(astroLock);
if(gIslamicCalendarAstro == NULL) {
gIslamicCalendarAstro = new CalendarAstronomer();
if (gIslamicCalendarAstro == NULL) {
}
gIslamicCalendarAstro->setTime(time);
age = gIslamicCalendarAstro->getMoonAge();
- umtx_unlock(&astroLock);
+ umtx_unlock(astroLock);
// Convert to degrees and normalize...
age = age * 180 / CalendarAstronomer::PI;
month = m;
}
} else { // invalid 'civil'
- U_ASSERT(false); // should not get here, out of range
- year=month=0;
+ UPRV_UNREACHABLE; // should not get here, out of range
}
dayOfMonth = (days - monthStart(year, month)) + 1;