lcid_en = MAKELCID(MAKELANGID(LANG_ENGLISH,SUBLANG_ENGLISH_US),SORT_DEFAULT);
week[0] = 0;
- GetLocaleInfoW(lcid_en, week_ids[(int)week_day(time)], week, sizeof(week)/sizeof(*week));
+ GetLocaleInfoW(lcid_en, week_ids[(int)week_day(time)], week, ARRAY_SIZE(week));
month[0] = 0;
- GetLocaleInfoW(lcid_en, month_ids[(int)month_from_time(time)], month, sizeof(month)/sizeof(*month));
+ GetLocaleInfoW(lcid_en, month_ids[(int)month_from_time(time)], month, ARRAY_SIZE(month));
year = year_from_time(time);
if(year<0) {
lcid_en = MAKELCID(MAKELANGID(LANG_ENGLISH,SUBLANG_ENGLISH_US),SORT_DEFAULT);
week[0] = 0;
- GetLocaleInfoW(lcid_en, week_ids[(int)week_day(date->time)], week, sizeof(week)/sizeof(*week));
+ GetLocaleInfoW(lcid_en, week_ids[(int)week_day(date->time)], week, ARRAY_SIZE(week));
month[0] = 0;
- GetLocaleInfoW(lcid_en, month_ids[(int)month_from_time(date->time)], month, sizeof(month)/sizeof(*month));
+ GetLocaleInfoW(lcid_en, month_ids[(int)month_from_time(date->time)], month, ARRAY_SIZE(month));
year = year_from_time(date->time);
if(year<0) {
lcid_en = MAKELCID(MAKELANGID(LANG_ENGLISH,SUBLANG_ENGLISH_US),SORT_DEFAULT);
week[0] = 0;
- GetLocaleInfoW(lcid_en, week_ids[(int)week_day(time)], week, sizeof(week)/sizeof(*week));
+ GetLocaleInfoW(lcid_en, week_ids[(int)week_day(time)], week, ARRAY_SIZE(week));
month[0] = 0;
- GetLocaleInfoW(lcid_en, month_ids[(int)month_from_time(time)], month, sizeof(month)/sizeof(*month));
+ GetLocaleInfoW(lcid_en, month_ids[(int)month_from_time(time)], month, ARRAY_SIZE(month));
year = year_from_time(time);
if(year<0) {
static const builtin_info_t Date_info = {
JSCLASS_DATE,
{NULL, NULL,0, Date_get_value},
- sizeof(Date_props)/sizeof(*Date_props),
+ ARRAY_SIZE(Date_props),
Date_props,
NULL,
NULL
LOCALE_SMONTHNAME1, LOCALE_SDAYNAME7, LOCALE_SDAYNAME1,
LOCALE_SDAYNAME2, LOCALE_SDAYNAME3, LOCALE_SDAYNAME4,
LOCALE_SDAYNAME5, LOCALE_SDAYNAME6 };
- WCHAR *strings[sizeof(string_ids)/sizeof(DWORD)];
+ WCHAR *strings[ARRAY_SIZE(string_ids)];
WCHAR *parse;
int input_len, parse_len = 0, nest_level = 0, i, size;
int year = 0, month = 0, day = 0, hour = 0, min = 0, sec = 0;
/* FIXME: Cache strings */
lcid_en = MAKELCID(MAKELANGID(LANG_ENGLISH,SUBLANG_ENGLISH_US),SORT_DEFAULT);
- for(i=0; i<sizeof(string_ids)/sizeof(DWORD); i++) {
+ for(i=0; i<ARRAY_SIZE(string_ids); i++) {
size = GetLocaleInfoW(lcid_en, string_ids[i], NULL, 0);
strings[i] = heap_alloc((size+1)*sizeof(WCHAR));
if(!strings[i]) {
for(size=i; parse[size]>='A' && parse[size]<='Z'; size++);
size -= i;
- for(j=0; j<sizeof(string_ids)/sizeof(DWORD); j++)
+ for(j=0; j<ARRAY_SIZE(string_ids); j++)
if(!strncmpiW(&parse[i], strings[j], size)) break;
if(j < 12) {
set_month = TRUE;
month = 11-j;
}
- else if(j == sizeof(string_ids)/sizeof(DWORD)) break;
+ else if(j == ARRAY_SIZE(string_ids)) break;
i += size;
}
*ret = NAN;
}
- for(i=0; i<sizeof(string_ids)/sizeof(DWORD); i++)
+ for(i=0; i<ARRAY_SIZE(string_ids); i++)
heap_free(strings[i]);
heap_free(parse);
static const builtin_info_t DateConstr_info = {
JSCLASS_FUNCTION,
DEFAULT_FUNCTION_VALUE,
- sizeof(DateConstr_props)/sizeof(*DateConstr_props),
+ ARRAY_SIZE(DateConstr_props),
DateConstr_props,
NULL,
NULL