Repository: libsdl-org/SDL
File: src/joystick/hidapi/SDL_hidapi_lg4ff.c (C)

Code before:
{
    Uint8 last_report_buf[32];
    bool initialized;
    bool is_ffex;
    Uint16 range;
} SDL_DriverLg4ff_Context;

static void HIDAPI_DriverLg4ff_RegisterHints(SDL_HintCallback callback, void *userdata)
{
    SDL_AddHintCallback(SDL_HINT_JOYSTICK_HIDAPI_LG4FF, callback, userdata);
}

static void HIDAPI_DriverLg4ff_UnregisterHints(SDL_HintCallback callback, void *userdata)
{
    SDL_RemoveHintCallback(SDL_HINT_JOYSTICK_HIDAPI_LG4FF, callback, userdata);
}

static bool HIDAPI_DriverLg4ff_IsEnabled(void)
{
    #if defined(SDL_PLATFORM_WIN32) || defined(SDL_PLATFORM_WINGDK)
    /*
     * hid.dll simply cannot send 7 bytes reports unlike other platforms
     * it enforces full length repots of 17 from the device's descriptor, which does not work on the device
     * this breaks ffb and led control, so we disable this by default
     */
    static bool hint_default = false;
    #else
    bool hint_default = SDL_GetHintBoolean(SDL_HINT_JOYSTICK_HIDAPI, SDL_HIDAPI_DEFAULT);
    #endif
    bool enabled = SDL_GetHintBoolean(SDL_HINT_JOYSTICK_HIDAPI_LG4FF, hint_default);

    return enabled;
}

/*
  Wheel id information by:
  Michal Malý <madcatxster@devoid-pointer.net> <madcatxster@gmail.com>
  Simon Wood <simon@mungewell.org>
  `git blame v6.12 drivers/hid/hid-lg4ff.c`, https://github.com/torvalds/linux.git
*/
static Uint16 HIDAPI_DriverLg4ff_IdentifyWheel(Uint16 device_id, Uint16 release_number)
{
    #define is_device(ret, m, r) { \
        if ((release_number & m) == r) { \
            return ret; \
        } \
    }
    #define is_dfp { \
        is_device(USB_DEVICE_ID_LOGITECH_DFP_WHEEL, 0xf000, 0x1000); \
    }
    #define is_dfgt { \

Review comment (suggestion):
```suggestion
    bool hint_default = false;
```

Code after:
{
    Uint8 last_report_buf[32];
    bool initialized;
    bool is_ffex;
    Uint16 range;
} SDL_DriverLg4ff_Context;

static void HIDAPI_DriverLg4ff_RegisterHints(SDL_HintCallback callback, void *userdata)
{
    SDL_AddHintCallback(SDL_HINT_JOYSTICK_HIDAPI_LG4FF, callback, userdata);
}

static void HIDAPI_DriverLg4ff_UnregisterHints(SDL_HintCallback callback, void *userdata)
{
    SDL_RemoveHintCallback(SDL_HINT_JOYSTICK_HIDAPI_LG4FF, callback, userdata);
}

static bool HIDAPI_DriverLg4ff_IsEnabled(void)
{
    #if defined(SDL_PLATFORM_WIN32) || defined(SDL_PLATFORM_WINGDK)
    /*
     * hid.dll simply cannot send 7 bytes reports unlike other platforms
     * it enforces full length repots of 17 from the device's descriptor, which does not work on the device
     * this breaks ffb and led control, so we disable this by default
     */
    bool hint_default = false;
    #else
    bool hint_default = SDL_GetHintBoolean(SDL_HINT_JOYSTICK_HIDAPI, SDL_HIDAPI_DEFAULT);
    #endif
    bool enabled = SDL_GetHintBoolean(SDL_HINT_JOYSTICK_HIDAPI_LG4FF, hint_default);

    return enabled;
}

/*
  Wheel id information by:
  Michal Malý <madcatxster@devoid-pointer.net> <madcatxster@gmail.com>
  Simon Wood <simon@mungewell.org>
  `git blame v6.12 drivers/hid/hid-lg4ff.c`, https://github.com/torvalds/linux.git
*/
static Uint16 HIDAPI_DriverLg4ff_IdentifyWheel(Uint16 device_id, Uint16 release_number)
{
    #define is_device(ret, m, r) { \
        if ((release_number & m) == r) { \
            return ret; \
        } \
    }
    #define is_dfp { \
        is_device(USB_DEVICE_ID_LOGITECH_DFP_WHEEL, 0xf000, 0x1000); \
    }
    #define is_dfgt { \