static device_t* _cast_device(const oe_device_t* device_)
{
    device_t* device = (device_t*)device_;

    if (device == NULL || device->magic != DEVICE_MAGIC)
        return NULL;

    return device;
}
static device_t* _cast_device(const oe_device_t* device_)
{
    device_t* device = (device_t*)device_;

    if (device == NULL || device->magic != DEVICE_MAGIC)
        return NULL;

    return device;
}