mirror of
https://github.com/libretro/RetroArch
synced 2025-04-10 15:45:19 +00:00
Get rid of initial for loop C89 noncompliance
* uwp_main.c - code style cleanups
This commit is contained in:
parent
182ab1a82e
commit
238f887931
@ -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];
|
||||
|
@ -55,8 +55,9 @@
|
||||
/* (C) libtransistor */
|
||||
static int pdep(uint32_t mask, uint32_t value)
|
||||
{
|
||||
int shift;
|
||||
uint32_t out = 0;
|
||||
for (int shift = 0; shift < 32; shift++)
|
||||
for (shift = 0; shift < 32; shift++)
|
||||
{
|
||||
uint32_t bit = 1u << shift;
|
||||
if (mask & bit)
|
||||
|
@ -949,11 +949,12 @@ 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;
|
||||
|
@ -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;
|
||||
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);
|
||||
|
@ -755,9 +755,10 @@ void App::ParseProtocolArgs(Windows::ApplicationModel::Activation::IActivatedEve
|
||||
|
||||
if (!m_initialized)
|
||||
{
|
||||
int i;
|
||||
(*argc) = argvTmp->size();
|
||||
/* Convert to char* array compatible with argv */
|
||||
for (int i = 0; i < argvTmp->size(); i++)
|
||||
for (i = 0; i < argvTmp->size(); i++)
|
||||
argv->push_back((char*)(argvTmp->at(i)).c_str());
|
||||
argv->push_back(nullptr);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user