wineandroid.drv: Use the ARRAY_SIZE() macro.

Signed-off-by: Michael Stefaniuc <mstefani@winehq.org>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Michael Stefaniuc 2018-08-16 20:19:30 +02:00 committed by Alexandre Julliard
parent 5e96cd7244
commit ccf6211c0a
3 changed files with 8 additions and 8 deletions

View File

@ -1363,7 +1363,7 @@ static int perform( ANativeWindow *window, int operation, ... )
case NATIVE_WINDOW_SET_POST_TRANSFORM_CROP:
default:
FIXME( "unsupported perform hwnd %p op %d %s\n", win->hwnd, operation,
operation < sizeof(names)/sizeof(names[0]) ? names[operation] : "???" );
operation < ARRAY_SIZE( names ) ? names[operation] : "???" );
break;
}
va_end( args );
@ -1419,7 +1419,7 @@ void release_ioctl_window( struct ANativeWindow *window )
if (InterlockedDecrement( &win->ref ) > 0) return;
TRACE( "%p %p\n", win, win->hwnd );
for (i = 0; i < sizeof(win->buffers)/sizeof(win->buffers[0]); i++)
for (i = 0; i < ARRAY_SIZE( win->buffers ); i++)
if (win->buffers[i]) win->buffers[i]->buffer.common.decRef( &win->buffers[i]->buffer.common );
destroy_ioctl_window( win->hwnd, win->opengl );

View File

@ -677,7 +677,7 @@ static BOOL process_attach(void)
load_android_libs();
(*java_vm)->AttachCurrentThread( java_vm, &jni_env, 0 );
class = (*jni_env)->GetObjectClass( jni_env, object );
(*jni_env)->RegisterNatives( jni_env, class, methods, sizeof(methods)/sizeof(methods[0]) );
(*jni_env)->RegisterNatives( jni_env, class, methods, ARRAY_SIZE( methods ));
(*jni_env)->DeleteLocalRef( jni_env, class );
#ifdef __i386__
wine_set_fs( old_fs ); /* the Java VM hijacks %fs for its own purposes, restore it */

View File

@ -638,7 +638,7 @@ static UINT scancode_to_vkey( UINT scan )
{
UINT j;
for (j = 0; j < sizeof(vkey_to_scancode)/sizeof(vkey_to_scancode[0]); j++)
for (j = 0; j < ARRAY_SIZE( vkey_to_scancode ); j++)
if (vkey_to_scancode[j] == scan)
return j;
return 0;
@ -648,7 +648,7 @@ static const char* vkey_to_name( UINT vkey )
{
UINT j;
for (j = 0; j < sizeof(vkey_names)/sizeof(vkey_names[0]); j++)
for (j = 0; j < ARRAY_SIZE( vkey_names ); j++)
if (vkey_names[j].vkey == vkey)
return vkey_names[j].name;
return NULL;
@ -724,7 +724,7 @@ jboolean keyboard_event( JNIEnv *env, jobject obj, jint win, jint action, jint k
{
union event_data data;
if ((unsigned int)keycode >= sizeof(keycode_to_vkey)/sizeof(keycode_to_vkey[0]) ||
if ((unsigned int)keycode >= ARRAY_SIZE( keycode_to_vkey ) ||
!keycode_to_vkey[keycode])
{
p__android_log_print( ANDROID_LOG_WARN, "wine",
@ -931,7 +931,7 @@ UINT CDECL ANDROID_MapVirtualKeyEx( UINT code, UINT maptype, HKL hkl )
code = VK_LMENU;
break;
}
if (code < sizeof(vkey_to_scancode) / sizeof(vkey_to_scancode[0])) ret = vkey_to_scancode[code];
if (code < ARRAY_SIZE( vkey_to_scancode )) ret = vkey_to_scancode[code];
break;
case MAPVK_VSC_TO_VK:
case MAPVK_VSC_TO_VK_EX:
@ -993,7 +993,7 @@ HKL CDECL ANDROID_GetKeyboardLayout( DWORD thread_id )
SHORT CDECL ANDROID_VkKeyScanEx( WCHAR ch, HKL hkl )
{
SHORT ret = -1;
if (ch < sizeof(char_vkey_map) / sizeof(char_vkey_map[0])) ret = char_vkey_map[ch];
if (ch < ARRAY_SIZE( char_vkey_map )) ret = char_vkey_map[ch];
TRACE_(key)( "ch %04x hkl %p -> %04x\n", ch, hkl, ret );
return ret;
}