FE(DIEFF_SPHERICAL)
#undef FE
};
- for (i = 0; i < (sizeof(flags) / sizeof(flags[0])); i++)
+ for (i = 0; i < ARRAY_SIZE(flags); i++)
if (flags[i].mask & dwFlags)
TRACE("%s ", flags[i].name);
TRACE("\n");
LPCWSTR lpszUserName,
DWORD dwFlags)
{
+ static const DWORD object_types[] = { DIDFT_AXIS, DIDFT_BUTTON };
+ static const DWORD type_map[] = { DIDFT_RELAXIS, DIDFT_PSHBUTTON };
JoystickGenericImpl *This = impl_from_IDirectInputDevice8W(iface);
unsigned int i, j;
BOOL has_actions = FALSE;
- DWORD object_types[] = { DIDFT_AXIS, DIDFT_BUTTON };
- DWORD type_map[] = { DIDFT_RELAXIS, DIDFT_PSHBUTTON };
FIXME("(%p)->(%p,%s,%08x): semi-stub !\n", iface, lpdiaf, debugstr_w(lpszUserName), dwFlags);
/* Only consider actions of the right genre */
if (lpdiaf->dwGenre != genre && genre != DIGENRE_ANY) continue;
- for (j=0; j < sizeof(object_types)/sizeof(object_types[0]); j++)
+ for (j = 0; j < ARRAY_SIZE(object_types); j++)
{
if (type & object_types[j])
{
{
int i;
- for (i = 0; i < sizeof(axis_names) / sizeof(axis_names[0]); i++)
+ for (i = 0; i < ARRAY_SIZE(axis_names); i++)
{
if (!strcmp(ptr, axis_names[i]))
{
}
}
- if (i == sizeof(axis_names) / sizeof(axis_names[0]))
+ if (i == ARRAY_SIZE(axis_names))
{
ERR("invalid joystick axis type: \"%s\"\n", ptr);
i = -1;