more "'for' loop initial declarations are only allowed in C99 mode" fixes

This commit is contained in:
Ozkan Sezer 2020-12-17 14:11:00 +03:00
parent ed4fcb2cfc
commit 90456670b5
6 changed files with 38 additions and 38 deletions

View File

@ -362,14 +362,14 @@ static void put_utf8(SDL_EVDEV_keyboard_state *kbd, uint c)
static unsigned int handle_diacr(SDL_EVDEV_keyboard_state *kbd, unsigned int ch)
{
unsigned int d = kbd->diacr;
unsigned int i;
unsigned int i, j;
kbd->diacr = 0;
for (i = 0; i < kbd->accents->n_accs; i++) {
if (kbd->accents->acc[i].accchar == d)
{
for (int j = 0; j < NUM_ACCENTCHARS; ++j) {
for (j = 0; j < NUM_ACCENTCHARS; ++j) {
if (kbd->accents->acc[i].map[j][0] == 0) /* end of table */
break;
if (kbd->accents->acc[i].map[j][0] == ch)
@ -549,12 +549,12 @@ SDL_EVDEV_kbd_keycode(SDL_EVDEV_keyboard_state *kbd, unsigned int keycode, int d
}
}
} else {
if (map_from_key_sym == '\n' || map_from_key_sym == '\r') {
if (kbd->diacr) {
kbd->diacr = 0;
return;
}
}
if (map_from_key_sym == '\n' || map_from_key_sym == '\r') {
if (kbd->diacr) {
kbd->diacr = 0;
return;
}
}
if (map_from_key_sym >= ' ' && map_from_key_sym != 127) {
k_self(kbd, map_from_key_sym, !down);
}

View File

@ -1002,23 +1002,23 @@ HID_API_EXPORT const wchar_t * HID_API_CALL hid_error(hid_device *dev)
/*#define S11*/
#define P32
#ifdef S11
unsigned short VendorID = 0xa0a0;
unsigned short VendorID = 0xa0a0;
unsigned short ProductID = 0x0001;
#endif
#ifdef P32
unsigned short VendorID = 0x04d8;
unsigned short VendorID = 0x04d8;
unsigned short ProductID = 0x3f;
#endif
#ifdef PICPGM
unsigned short VendorID = 0x04d8;
unsigned short ProductID = 0x0033;
unsigned short VendorID = 0x04d8;
unsigned short ProductID = 0x0033;
#endif
int __cdecl main(int argc, char* argv[])
{
int res;
int i, res;
unsigned char buf[65];
UNREFERENCED_PARAMETER(argc);
@ -1054,7 +1054,7 @@ int __cdecl main(int argc, char* argv[])
printf("Unable to read()\n");
/* Print out the returned buffer. */
for (int i = 0; i < 4; i++)
for (i = 0; i < 4; i++)
printf("buf[%d]: %d\n", i, buf[i]);
return 0;

View File

@ -600,10 +600,10 @@ static SDL_INLINE EControllerType GuessControllerType( int nVID, int nPID )
if ( !s_bCheckedForDuplicates )
{
s_bCheckedForDuplicates = true;
for ( int i = 0; i < sizeof( arrControllers ) / sizeof( arrControllers[ 0 ] ); ++i )
int i, j;
for ( i = 0; i < sizeof( arrControllers ) / sizeof( arrControllers[ 0 ] ); ++i )
{
for ( int j = i + 1; j < sizeof( arrControllers ) / sizeof( arrControllers[ 0 ] ); ++j )
for ( j = i + 1; j < sizeof( arrControllers ) / sizeof( arrControllers[ 0 ] ); ++j )
{
if ( arrControllers[ i ].m_unDeviceID == arrControllers[ j ].m_unDeviceID )
{

View File

@ -577,10 +577,10 @@ RAWINPUT_WindowsGamingInputSlotMatches(const WindowsMatchState *state, WindowsGa
static SDL_bool
RAWINPUT_GuessWindowsGamingInputSlot(const WindowsMatchState *state, Uint8 *correlation_id, WindowsGamingInputGamepadState **slot)
{
int match_count;
int match_count, user_index;
match_count = 0;
for (int user_index = 0; user_index < wgi_state.per_gamepad_count; ++user_index) {
for (user_index = 0; user_index < wgi_state.per_gamepad_count; ++user_index) {
WindowsGamingInputGamepadState *gamepad_state = wgi_state.per_gamepad[user_index];
if (RAWINPUT_WindowsGamingInputSlotMatches(state, gamepad_state)) {
++match_count;
@ -604,7 +604,8 @@ RAWINPUT_QuitWindowsGamingInput(RAWINPUT_DeviceContext *ctx)
wgi_state.need_device_list_update = SDL_TRUE;
--wgi_state.ref_count;
if (!wgi_state.ref_count && wgi_state.initialized) {
for (int ii = 0; ii < wgi_state.per_gamepad_count; ii++) {
int ii;
for (ii = 0; ii < wgi_state.per_gamepad_count; ii++) {
__x_ABI_CWindows_CGaming_CInput_CIGamepad_Release(wgi_state.per_gamepad[ii]->gamepad);
}
if (wgi_state.per_gamepad) {

View File

@ -197,8 +197,9 @@ GetDisplayMode(_THIS, CGDisplayModeRef vidmode, CFArrayRef modelist, CVDisplayLi
int pixelH = (int) CGDisplayModeGetPixelHeight(vidmode);
CFIndex modescount = CFArrayGetCount(modelist);
int i;
for (int i = 0; i < modescount; i++) {
for (i = 0; i < modescount; i++) {
CGDisplayModeRef othermode = (CGDisplayModeRef) CFArrayGetValueAtIndex(modelist, i);
uint32_t otherioflags = CGDisplayModeGetIOFlags(othermode);

View File

@ -381,19 +381,17 @@ void print_plane_info(_THIS, drmModePlanePtr plane)
drmModeRes *resources;
uint32_t type = 0;
SDL_VideoData *viddata = ((SDL_VideoData *)_this->driverdata);
int i;
drmModeObjectPropertiesPtr props = KMSDRM_drmModeObjectGetProperties(viddata->drm_fd,
plane->plane_id, DRM_MODE_OBJECT_PLANE);
/* Search the plane props for the plane type. */
for (int j = 0; j < props->count_props; j++) {
drmModePropertyPtr p = KMSDRM_drmModeGetProperty(viddata->drm_fd, props->props[j]);
for (i = 0; i < props->count_props; i++) {
drmModePropertyPtr p = KMSDRM_drmModeGetProperty(viddata->drm_fd, props->props[i]);
if ((strcmp(p->name, "type") == 0)) {
type = props->prop_values[j];
type = props->prop_values[i];
}
KMSDRM_drmModeFreeProperty(p);
}
@ -422,7 +420,7 @@ void print_plane_info(_THIS, drmModePlanePtr plane)
return;
printf("--PLANE ID: %d\nPLANE TYPE: %s\nCRTC READING THIS PLANE: %d\nCRTCS SUPPORTED BY THIS PLANE: ", plane->plane_id, plane_type, plane->crtc_id);
for (int i = 0; i < resources->count_crtcs; i++) {
for (i = 0; i < resources->count_crtcs; i++) {
if (plane->possible_crtcs & (1 << i)) {
uint32_t crtc_id = resources->crtcs[i];
printf ("%d", crtc_id);