mirror of
https://github.com/libretro/RetroArch
synced 2025-02-20 06:40:18 +00:00
Clean up some C99 longlongs.
This commit is contained in:
parent
1a448e3054
commit
97f8188969
@ -519,7 +519,7 @@ static bool thread_frame(void *data, const void *frame_,
|
||||
settings_t *settings = config_get_ptr();
|
||||
|
||||
retro_time_t target_frame_time = (retro_time_t)
|
||||
roundf(1000000LL / settings->video.refresh_rate);
|
||||
roundf(1000000 / settings->video.refresh_rate);
|
||||
retro_time_t target = thr->last_time + target_frame_time;
|
||||
|
||||
/* Ideally, use absolute time, but that is only a good idea on POSIX. */
|
||||
|
@ -81,7 +81,7 @@ static struct udev_joypad udev_pads[MAX_USERS];
|
||||
static INLINE int16_t udev_compute_axis(const struct input_absinfo *info, int value)
|
||||
{
|
||||
int range = info->maximum - info->minimum;
|
||||
int axis = (value - info->minimum) * 0xffffll / range - 0x7fffll;
|
||||
int axis = (value - info->minimum) * 0xffff / range - 0x7fff;
|
||||
|
||||
if (axis > 0x7fff)
|
||||
return 0x7fff;
|
||||
|
@ -33,7 +33,7 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef uint64_t retro_input_t ;
|
||||
typedef uint64_t retro_input_t;
|
||||
|
||||
struct retro_keybind
|
||||
{
|
||||
|
@ -412,11 +412,11 @@ bool scond_wait_timeout(scond_t *cond, slock_t *lock, int64_t timeout_us)
|
||||
clock_gettime(CLOCK_REALTIME, &now);
|
||||
#endif
|
||||
|
||||
now.tv_sec += timeout_us / 1000000LL;
|
||||
now.tv_nsec += timeout_us * 1000LL;
|
||||
now.tv_sec += timeout_us / 1000000;
|
||||
now.tv_nsec += timeout_us * 1000;
|
||||
|
||||
now.tv_sec += now.tv_nsec / 1000000000LL;
|
||||
now.tv_nsec = now.tv_nsec % 1000000000LL;
|
||||
now.tv_sec += now.tv_nsec / 1000000000;
|
||||
now.tv_nsec = now.tv_nsec % 1000000000;
|
||||
|
||||
ret = pthread_cond_timedwait(&cond->cond, &lock->lock, &now);
|
||||
return (ret == 0);
|
||||
|
@ -540,7 +540,7 @@ int rmsgpack_read(FILE *fp,
|
||||
case 0xcd:
|
||||
case 0xce:
|
||||
case 0xcf:
|
||||
tmp_len = 1ULL << (type - 0xcc);
|
||||
tmp_len = 1UL << (type - 0xcc);
|
||||
tmp_uint = 0;
|
||||
if (read_uint(fp, &tmp_uint, tmp_len) == -1)
|
||||
return -errno;
|
||||
@ -552,7 +552,7 @@ int rmsgpack_read(FILE *fp,
|
||||
case 0xd1:
|
||||
case 0xd2:
|
||||
case 0xd3:
|
||||
tmp_len = 1ULL << (type - 0xd0);
|
||||
tmp_len = 1UL << (type - 0xd0);
|
||||
tmp_int = 0;
|
||||
if (read_int(fp, &tmp_int, tmp_len) == -1)
|
||||
return -errno;
|
||||
|
@ -336,9 +336,9 @@ static INLINE void input_poll_overlay(input_overlay_t *overlay_device, float opa
|
||||
if (driver->overlay_state.analog[j])
|
||||
continue;
|
||||
|
||||
if (driver->overlay_state.buttons & (1ULL << bind_plus))
|
||||
if (driver->overlay_state.buttons & (1UL << bind_plus))
|
||||
driver->overlay_state.analog[j] += 0x7fff;
|
||||
if (driver->overlay_state.buttons & (1ULL << bind_minus))
|
||||
if (driver->overlay_state.buttons & (1UL << bind_minus))
|
||||
driver->overlay_state.analog[j] -= 0x7fff;
|
||||
}
|
||||
|
||||
@ -359,13 +359,13 @@ static INLINE void input_poll_overlay(input_overlay_t *overlay_device, float opa
|
||||
analog_y = (float)driver->overlay_state.analog[analog_base + 1] / 0x7fff;
|
||||
|
||||
if (analog_x <= -settings->input.axis_threshold)
|
||||
driver->overlay_state.buttons |= (1ULL << RETRO_DEVICE_ID_JOYPAD_LEFT);
|
||||
driver->overlay_state.buttons |= (1UL << RETRO_DEVICE_ID_JOYPAD_LEFT);
|
||||
if (analog_x >= settings->input.axis_threshold)
|
||||
driver->overlay_state.buttons |= (1ULL << RETRO_DEVICE_ID_JOYPAD_RIGHT);
|
||||
driver->overlay_state.buttons |= (1UL << RETRO_DEVICE_ID_JOYPAD_RIGHT);
|
||||
if (analog_y <= -settings->input.axis_threshold)
|
||||
driver->overlay_state.buttons |= (1ULL << RETRO_DEVICE_ID_JOYPAD_UP);
|
||||
driver->overlay_state.buttons |= (1UL << RETRO_DEVICE_ID_JOYPAD_UP);
|
||||
if (analog_y >= settings->input.axis_threshold)
|
||||
driver->overlay_state.buttons |= (1ULL << RETRO_DEVICE_ID_JOYPAD_DOWN);
|
||||
driver->overlay_state.buttons |= (1UL << RETRO_DEVICE_ID_JOYPAD_DOWN);
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -969,12 +969,12 @@ unsigned menu_input_frame(retro_input_t input, retro_input_t trigger_input)
|
||||
static bool initial_held = true;
|
||||
static bool first_held = false;
|
||||
static const retro_input_t input_repeat =
|
||||
(1ULL << RETRO_DEVICE_ID_JOYPAD_UP)
|
||||
| (1ULL << RETRO_DEVICE_ID_JOYPAD_DOWN)
|
||||
| (1ULL << RETRO_DEVICE_ID_JOYPAD_LEFT)
|
||||
| (1ULL << RETRO_DEVICE_ID_JOYPAD_RIGHT)
|
||||
| (1ULL << RETRO_DEVICE_ID_JOYPAD_L)
|
||||
| (1ULL << RETRO_DEVICE_ID_JOYPAD_R);
|
||||
(1UL << RETRO_DEVICE_ID_JOYPAD_UP)
|
||||
| (1UL << RETRO_DEVICE_ID_JOYPAD_DOWN)
|
||||
| (1UL << RETRO_DEVICE_ID_JOYPAD_LEFT)
|
||||
| (1UL << RETRO_DEVICE_ID_JOYPAD_RIGHT)
|
||||
| (1UL << RETRO_DEVICE_ID_JOYPAD_L)
|
||||
| (1UL << RETRO_DEVICE_ID_JOYPAD_R);
|
||||
menu_navigation_t *nav = menu_navigation_get_ptr();
|
||||
menu_handle_t *menu = menu_driver_get_ptr();
|
||||
menu_display_t *disp = menu_display_get_ptr();
|
||||
|
Loading…
x
Reference in New Issue
Block a user