Skip to content

Commit d76c015

Browse files
Merge pull request #17796 from pstef/silence-warnings
2 parents ccc68a9 + c048a21 commit d76c015

12 files changed

Lines changed: 44 additions & 18 deletions

File tree

configuration.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6178,7 +6178,11 @@ bool input_remapping_save_file(const char *path)
61786178
if (skip_port)
61796179
continue;
61806180

6181-
snprintf(formatted_number, sizeof(formatted_number), "%u", i + 1);
6181+
_len = snprintf(formatted_number, sizeof(formatted_number), "%u", i + 1);
6182+
if (_len >= sizeof(formatted_number)) {
6183+
RARCH_ERR("[Config]: unexpectedly high number of users");
6184+
break;
6185+
}
61826186
_len = strlcpy(prefix, "input_player", sizeof(prefix));
61836187
strlcpy(prefix + _len, formatted_number, sizeof(prefix) - _len);
61846188
_len = strlcpy(s1, prefix, sizeof(s1));

deps/dr/dr_flac.h

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -682,10 +682,17 @@ const char* drflac_next_vorbis_comment(drflac_vorbis_comment_iterator* pIter, dr
682682
#define DRFLAC_NO_CPUID
683683
#endif
684684

685-
686685
#ifdef __linux__
687-
#define _BSD_SOURCE
688-
#include <endian.h>
686+
#ifndef _BSD_SOURCE
687+
#define _BSD_SOURCE
688+
#endif
689+
#ifndef _DEFAULT_SOURCE
690+
#define _DEFAULT_SOURCE
691+
#endif
692+
#ifndef __USE_BSD
693+
#define __USE_BSD
694+
#endif
695+
#include <endian.h>
689696
#endif
690697

691698
#if defined(_MSC_VER) && _MSC_VER >= 1500 && (defined(DRFLAC_X86) || defined(DRFLAC_X64))

frontend/drivers/platform_ps2.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -343,7 +343,7 @@ static void frontend_ps2_exec(const char *path, bool should_load_game)
343343
deinit_drivers(true, true);
344344
reset_IOP();
345345
common_init_drivers(false);
346-
waitUntilDeviceIsReady(path);
346+
waitUntilDeviceIsReady((char *)path);
347347

348348
#ifndef IS_SALAMANDER
349349
char game_path[FILENAME_MAX];

frontend/drivers/platform_ps3.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -436,16 +436,16 @@ static void frontend_ps3_exec(const char *path, bool should_load_game)
436436
{
437437
#ifndef IS_SALAMANDER
438438
#ifdef HAVE_NETWORKING
439-
char *arg_data[NETPLAY_FORK_MAX_ARGS];
439+
const char *arg_data[NETPLAY_FORK_MAX_ARGS];
440440
#else
441-
char *arg_data[2];
441+
const char *arg_data[2];
442442
#endif
443443
char game_path[PATH_MAX_LENGTH];
444444
bool verbosity = verbosity_is_enabled();
445445

446446
verbosity_enable();
447447
#else
448-
char *arg_data[1];
448+
const char *arg_data[1];
449449
#endif
450450

451451
arg_data[0] = NULL;

gfx/drivers/gl_shaders/pipeline_snow.glsl.vert.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#include "shaders_common.h"
22

3+
#if defined(HAVE_OPENGLES)
34
/* Need to duplicate these to work around broken stuff on Android.
45
* Must enforce alpha = 1.0 or 32-bit games can potentially go black. */
56
static const char *stock_vertex_xmb_snow = GLSL(
@@ -14,3 +15,4 @@ static const char *stock_vertex_xmb_snow = GLSL(
1415
tex_coord = TexCoord;
1516
}
1617
);
18+
#endif

gfx/drivers_shader/shader_glsl.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,11 @@
4444
#include "../../deps/xxHash/xxhash.h"
4545
#endif
4646

47+
#if defined(VITA)
48+
#include <psp2/kernel/threadmgr/thread.h>
49+
#include <psp2/power.h>
50+
#endif
51+
4752
#define PREV_TEXTURES (GFX_MAX_TEXTURES - 1)
4853

4954
/* Cache the VBO. */

input/drivers_joypad/switch_joypad.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -430,7 +430,7 @@ bool switch_joypad_set_rumble(unsigned pad,
430430
HidVibrationDeviceHandle* handle;
431431
float amp;
432432

433-
if (pad >= DEFAULT_MAX_PADS || !vibration_handles[pad])
433+
if (pad >= DEFAULT_MAX_PADS)
434434
return false;
435435

436436
amp = (float)strength / 65535.0f;

input/input_driver.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,9 @@
6262
#include "../verbosity.h"
6363

6464
#include "../ai/game_ai.h"
65+
#if defined(_WIN32)
66+
#include <winsock2.h>
67+
#endif
6568

6669
#define HOLD_BTN_DELAY_SEC 2
6770

@@ -6776,7 +6779,12 @@ void input_driver_poll(void)
67766779
ssize_t ret;
67776780
struct remote_message msg;
67786781

6782+
6783+
#if defined(_WIN32)
6784+
if (input_st->remote->net_fd[user] == INVALID_SOCKET)
6785+
#else
67796786
if (input_st->remote->net_fd[user] < 0)
6787+
#endif
67806788
return;
67816789

67826790
FD_ZERO(&fds);

libretro-common/features/features_cpu.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,8 @@ retro_time_t cpu_features_get_time_usec(void)
269269
#endif
270270

271271
#if defined(CPU_X86) && !defined(__MACH__)
272-
void x86_cpuid(int func, int flags[4])
272+
#include <limits.h>
273+
void x86_cpuid(int func, int32_t flags[4])
273274
{
274275
/* On Android, we compile RetroArch with PIC, and we
275276
* are not allowed to clobber the ebx register. */
@@ -288,8 +289,8 @@ void x86_cpuid(int func, int flags[4])
288289
"xchg %%" REG_b ", %%" REG_S "\n"
289290
: "=a"(flags[0]), "=S"(flags[1]), "=c"(flags[2]), "=d"(flags[3])
290291
: "a"(func));
291-
#elif defined(_MSC_VER)
292-
__cpuid(flags, func);
292+
#elif defined(_MSC_VER) && INT_MAX == 2147483647
293+
__cpuid((int*)flags, func);
293294
#else
294295
#ifndef NDEBUG
295296
printf("Unknown compiler. Cannot check CPUID with inline assembly.\n");

menu/cbs/menu_cbs_sublabel.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1826,7 +1826,7 @@ static int action_bind_sublabel_netplay_kick_client(file_list_t *list,
18261826
if (status)
18271827
{
18281828
size_t _len = strlcpy(buf, msg_hash_to_str(MENU_ENUM_LABEL_VALUE_STATUS),
1829-
sizeof(buf));
1829+
sizeof(buf) - 3);
18301830
buf[ _len] = ':';
18311831
buf[++_len] = ' ';
18321832
buf[++_len] = '\0';

0 commit comments

Comments
 (0)