1
0
mirror of https://github.com/libretro/RetroArch synced 2024-07-08 12:15:49 +00:00

Get rid of initial for loop C89 noncompliance

* uwp_main.c - code style cleanups
This commit is contained in:
libretroadmin 2023-04-23 10:47:09 +02:00
parent 182ab1a82e
commit 238f887931
5 changed files with 571 additions and 564 deletions

View File

@ -613,6 +613,10 @@ matrix_float4x4 matrix_proj_ortho(float left, float right, float top, float bott
- (bool)readBackBuffer:(uint8_t *)buffer
{
int x, y;
NSUInteger dstStride, srcStride;
uint8_t const *src;
uint8_t *dst, *tmp;
if (!_captureEnabled || _backBuffer == nil)
return NO;
@ -622,22 +626,22 @@ matrix_float4x4 matrix_proj_ortho(float left, float right, float top, float bott
return NO;
}
uint8_t *tmp = malloc(_backBuffer.width * _backBuffer.height * 4);
tmp = malloc(_backBuffer.width * _backBuffer.height * 4);
[_backBuffer getBytes:tmp
bytesPerRow:4 * _backBuffer.width
fromRegion:MTLRegionMake2D(0, 0, _backBuffer.width, _backBuffer.height)
mipmapLevel:0];
NSUInteger srcStride = _backBuffer.width * 4;
uint8_t const *src = tmp + (_viewport.y * srcStride);
srcStride = _backBuffer.width * 4;
src = tmp + (_viewport.y * srcStride);
NSUInteger dstStride = _viewport.width * 3;
uint8_t *dst = buffer + (_viewport.height - 1) * dstStride;
dstStride = _viewport.width * 3;
dst = buffer + (_viewport.height - 1) * dstStride;
for (int y = 0; y < _viewport.height; y++, src += srcStride, dst -= dstStride)
for (y = 0; y < _viewport.height; y++, src += srcStride, dst -= dstStride)
{
for (int x = 0; x < _viewport.width; x++)
for (x = 0; x < _viewport.width; x++)
{
dst[3 * x + 0] = src[4 * (_viewport.x + x) + 0];
dst[3 * x + 1] = src[4 * (_viewport.x + x) + 1];
@ -679,7 +683,7 @@ matrix_float4x4 matrix_proj_ortho(float left, float right, float top, float bott
- (void)resetRenderViewport:(ViewportResetMode)mode
{
bool fullscreen = mode == kFullscreenViewport;
MTLViewport vp = {
MTLViewport vp = {
.originX = fullscreen ? 0 : _viewport.x,
.originY = fullscreen ? 0 : _viewport.y,
.width = fullscreen ? _viewport.full_width : _viewport.width,

View File

@ -55,18 +55,19 @@
/* (C) libtransistor */
static int pdep(uint32_t mask, uint32_t value)
{
uint32_t out = 0;
for (int shift = 0; shift < 32; shift++)
{
uint32_t bit = 1u << shift;
if (mask & bit)
{
if (value & 1)
out |= bit;
value >>= 1;
}
}
return out;
int shift;
uint32_t out = 0;
for (shift = 0; shift < 32; shift++)
{
uint32_t bit = 1u << shift;
if (mask & bit)
{
if (value & 1)
out |= bit;
value >>= 1;
}
}
return out;
}
static uint32_t swizzle_x(uint32_t v) { return pdep(~0x7B4u, v); }

View File

@ -949,18 +949,19 @@ static bool is_configured_as_physical_keyboard(int vendor_id, int product_id, co
if (is_keyboard)
{
int i;
/*
* Check that there is not already a similar physical keyboard attached
* attached to the system
*/
for (int i = 0; i < kbd_num; i++)
for (i = 0; i < kbd_num; i++)
{
char kbd_device_name[256] = { 0 };
int kbd_vendor_id = 0;
int kbd_product_id = 0;
int kbd_vendor_id = 0;
int kbd_product_id = 0;
if (!engine_lookup_name(kbd_device_name, &kbd_vendor_id,
&kbd_product_id, sizeof(kbd_device_name), kbd_id[i]))
&kbd_product_id, sizeof(kbd_device_name), kbd_id[i]))
return false;
if (compare_by_id && vendor_id == kbd_vendor_id && product_id == kbd_product_id)

View File

@ -1081,7 +1081,7 @@ static unsigned menu_displaylist_parse_core_manager_steam_list(
return count;
error:
/* TODO: Send error notification */
/* TODO/FIXME: Send error notification */
RARCH_ERR("[Steam] Error enumerating core dlcs for core manager (%d-%d)\n", MIST_UNPACK_RESULT(result));
return count;
}
@ -1091,21 +1091,21 @@ static unsigned menu_displaylist_parse_core_information_steam(
settings_t *settings)
{
unsigned count = 0;
MistResult result;
steam_core_dlc_list_t *dlc_list;
steam_core_dlc_t *core_dlc = NULL;
bool installed = false;
result = steam_get_core_dlcs(&dlc_list, false);
if (MIST_IS_ERROR(result)) goto error;
bool installed = false;
MistResult result = steam_get_core_dlcs(&dlc_list, false);
if (MIST_IS_ERROR(result))
goto error;
/* Get the core dlc information */
core_dlc = steam_get_core_dlc_by_name(dlc_list, info->path);
if (core_dlc == NULL) return count;
if (!(core_dlc = steam_get_core_dlc_by_name(dlc_list, info->path)))
return count;
/* Check if installed */
result = mist_steam_apps_is_dlc_installed(core_dlc->app_id, &installed);
if (MIST_IS_ERROR(result)) goto error;
if (MIST_IS_ERROR(result))
goto error;
if (installed)
{
@ -1139,6 +1139,7 @@ error:
static unsigned menu_displaylist_parse_core_option_dropdown_list(
menu_displaylist_info_t *info)
{
int j;
char val_d[8];
unsigned count = 0;
struct string_list tmp_str_list = {0};
@ -1152,7 +1153,6 @@ static unsigned menu_displaylist_parse_core_option_dropdown_list(
const char *lbl_disabled = NULL;
const char *val_on_str = NULL;
const char *val_off_str = NULL;
unsigned j;
/* Fetch options */
retroarch_ctl(RARCH_CTL_CORE_OPTIONS_LIST_GET, &coreopts);

File diff suppressed because it is too large Load Diff