From: twinaphex Date: Sun, 9 Apr 2017 13:49:52 +0000 (+0200) Subject: Turn min into macro X-Git-Tag: r24l~794 X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a9bb0712e8b70bf8f3c4a0025606c70a81594ab9;p=pcsx_rearmed.git Turn min into macro --- diff --git a/frontend/libretro.c b/frontend/libretro.c index ee29a9b2..7fd20b1a 100644 --- a/frontend/libretro.c +++ b/frontend/libretro.c @@ -39,6 +39,10 @@ #define PORTS_NUMBER 8 +#ifndef MIN +#define MIN(a, b) ((a) < (b) ? (a) : (b)) +#endif + #define ISHEXDEC ((buf[cursor]>='0') && (buf[cursor]<='9')) || ((buf[cursor]>='a') && (buf[cursor]<='f')) || ((buf[cursor]>='A') && (buf[cursor]<='F')) //hack to prevent retroarch freezing when reseting in the menu but not while running with the hot key @@ -1502,11 +1506,6 @@ static void update_variables(bool in_flight) } } -static int min(int a, int b) -{ - return a < b ? a : b; -} - void retro_run(void) { int i; @@ -1537,10 +1536,10 @@ void retro_run(void) if (in_type[i] == PSE_PAD_TYPE_ANALOGPAD) { - in_analog_left[i][0] = min((input_state_cb(i, RETRO_DEVICE_ANALOG, RETRO_DEVICE_INDEX_ANALOG_LEFT, RETRO_DEVICE_ID_ANALOG_X) / 255) + 128, 255); - in_analog_left[i][1] = min((input_state_cb(i, RETRO_DEVICE_ANALOG, RETRO_DEVICE_INDEX_ANALOG_LEFT, RETRO_DEVICE_ID_ANALOG_Y) / 255) + 128, 255); - in_analog_right[i][0] = min((input_state_cb(i, RETRO_DEVICE_ANALOG, RETRO_DEVICE_INDEX_ANALOG_RIGHT, RETRO_DEVICE_ID_ANALOG_X) / 255) + 128, 255); - in_analog_right[i][1] = min((input_state_cb(i, RETRO_DEVICE_ANALOG, RETRO_DEVICE_INDEX_ANALOG_RIGHT, RETRO_DEVICE_ID_ANALOG_Y) / 255) + 128, 255); + in_analog_left[i][0] = MIN((input_state_cb(i, RETRO_DEVICE_ANALOG, RETRO_DEVICE_INDEX_ANALOG_LEFT, RETRO_DEVICE_ID_ANALOG_X) / 255) + 128, 255); + in_analog_left[i][1] = MIN((input_state_cb(i, RETRO_DEVICE_ANALOG, RETRO_DEVICE_INDEX_ANALOG_LEFT, RETRO_DEVICE_ID_ANALOG_Y) / 255) + 128, 255); + in_analog_right[i][0] = MIN((input_state_cb(i, RETRO_DEVICE_ANALOG, RETRO_DEVICE_INDEX_ANALOG_RIGHT, RETRO_DEVICE_ID_ANALOG_X) / 255) + 128, 255); + in_analog_right[i][1] = MIN((input_state_cb(i, RETRO_DEVICE_ANALOG, RETRO_DEVICE_INDEX_ANALOG_RIGHT, RETRO_DEVICE_ID_ANALOG_Y) / 255) + 128, 255); } }