Commit 93b68051 authored by Michael Stefaniuc's avatar Michael Stefaniuc Committed by Alexandre Julliard

msvc90: Use the ARRAY_SIZE() macro.

parent 30905781
......@@ -3237,10 +3237,10 @@ FILE* __cdecl _Fiopen_wchar(const wchar_t *name, int mode, int prot)
TRACE("(%s %d %d)\n", debugstr_w(name), mode, prot);
for(mode_idx=0; mode_idx<sizeof(str_mode)/sizeof(str_mode[0]); mode_idx++)
for(mode_idx=0; mode_idx<ARRAY_SIZE(str_mode); mode_idx++)
if(str_mode[mode_idx].mode == real_mode)
break;
if(mode_idx == sizeof(str_mode)/sizeof(str_mode[0]))
if(mode_idx == ARRAY_SIZE(str_mode))
return NULL;
if((mode & OPENMODE__Nocreate) && !(f = _wfopen(name, rW)))
......@@ -3469,7 +3469,7 @@ int __thiscall basic_filebuf_char_uflow(basic_filebuf_char *this)
return c;
buf_next = buf;
for(i=0; i < sizeof(buf)/sizeof(buf[0]); i++) {
for(i=0; i < ARRAY_SIZE(buf); i++) {
buf[i] = c;
switch(codecvt_char_in(this->cvt, &this->state, buf_next,
......@@ -4112,7 +4112,7 @@ unsigned short __thiscall basic_filebuf_wchar_uflow(basic_filebuf_wchar *this)
return fgetwc(this->file);
buf_next = buf;
for(i=0; i < sizeof(buf)/sizeof(buf[0]); i++) {
for(i=0; i < ARRAY_SIZE(buf); i++) {
if((c = fgetc(this->file)) == EOF)
return WEOF;
buf[i] = c;
......
......@@ -786,11 +786,11 @@ int __cdecl _Getdateorder(void)
#if _MSVCP_VER < 110
if(!GetLocaleInfoW(___lc_handle_func()[LC_TIME], LOCALE_ILDATE,
date_fmt, sizeof(date_fmt)/sizeof(*date_fmt)))
date_fmt, ARRAY_SIZE(date_fmt)))
return DATEORDER_no_order;
#else
if(!GetLocaleInfoEx(___lc_locale_name_func()[LC_TIME], LOCALE_ILDATE,
date_fmt, sizeof(date_fmt)/sizeof(*date_fmt)))
date_fmt, ARRAY_SIZE(date_fmt)))
return DATEORDER_no_order;
#endif
......
......@@ -1781,7 +1781,7 @@ typedef struct __Concurrent_vector_base_v4
void **segment;
} _Concurrent_vector_base_v4;
#define STORAGE_SIZE (sizeof(this->storage) / sizeof(this->storage[0]))
#define STORAGE_SIZE ARRAY_SIZE(this->storage)
#define SEGMENT_SIZE (sizeof(void*) * 8)
typedef struct compact_block
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment