mirror of
https://github.com/libretro/RetroArch.git
synced 2026-11-07 08:36:02 -10:00
Fix Wii U, dingux and aarch64 build warnings
Wii U get_arguments() prints through the argc/argv pointers it was handed, and argv[1] only when there is one. The in-place URL decode passes the string's real size to string_percent_decode(), and Basic auth decodes its own buffer with the length it already has, so LTO no longer sees a SIZE_MAX bound wrapping around. Helpers only some configurations call are compiled for those only: the overlay-only input and menu helpers under HAVE_OVERLAY, the container-only audio_transfer time and movie-header helpers under their container, and the scalar xxh3 long path off NEON. hidraw hands autoconfig the stored vid/pid, rcheevos copies its operand by assignment, and the Qt companion asks QScreen from Qt 5.10 on.
This commit is contained in:
1 parent
f08faaa0a6
commit
b1194186ac
10 files changed
+33
-16
No files matched your search
+1
-1
@@ -166,7 +166,7 @@ static int rc_parse_operator(const char** memaddr) {
|
||||
void rc_condition_convert_to_operand(const rc_condition_t* condition, rc_operand_t* operand, rc_parse_state_t* parse) {
|
||||
if (condition->oper == RC_OPERATOR_NONE) {
|
||||
if (operand != &condition->operand1)
|
||||
memcpy(operand, &condition->operand1, sizeof(*operand));
|
||||
*operand = condition->operand1;
|
||||
}
|
||||
else {
|
||||
uint8_t new_size = RC_MEMSIZE_32_BITS;
|
||||
|
||||
@@ -439,9 +439,10 @@ static void get_arguments(int *argc, char ***argv)
|
||||
ARGV_PTR = NULL;
|
||||
}
|
||||
|
||||
DEBUG_VAR(argc);
|
||||
DEBUG_VAR(argv[0]);
|
||||
DEBUG_VAR(argv[1]);
|
||||
DEBUG_VAR(*argc);
|
||||
DEBUG_VAR((*argv)[0]);
|
||||
if (*argc > 1)
|
||||
DEBUG_VAR((*argv)[1]);
|
||||
fflush(stdout);
|
||||
}
|
||||
|
||||
|
||||
@@ -311,7 +311,7 @@ static void hidraw_hid_add(hidraw_hid_t *hid, const char *devnode)
|
||||
RARCH_LOG("[hidraw] \"%s\" at %s on port %d.\n",
|
||||
name, devnode, dev->slot + 1);
|
||||
input_autoconfigure_connect(name, NULL, NULL, "hid",
|
||||
dev->slot, vid, pid);
|
||||
dev->slot, dev->vid, dev->pid);
|
||||
}
|
||||
|
||||
/* A pad let go: @gone when it left, and is said to have; not when the
|
||||
|
||||
@@ -2722,6 +2722,7 @@ static bool input_gun_button_from_binds(input_driver_t *input, void *data,
|
||||
return true;
|
||||
}
|
||||
|
||||
#ifdef HAVE_OVERLAY
|
||||
/* A value from what the driver published, or from the driver. */
|
||||
static int16_t input_frame_or_driver(input_driver_t *input, void *data,
|
||||
const input_device_driver_t *joypad,
|
||||
@@ -2735,6 +2736,7 @@ static int16_t input_frame_or_driver(input_driver_t *input, void *data,
|
||||
return input->input_state(data, joypad, joypad_info, binds,
|
||||
port, device, idx, id);
|
||||
}
|
||||
#endif
|
||||
|
||||
INPUT_NOINLINE static int32_t input_state_wrap_slow(
|
||||
input_driver_t *input,
|
||||
|
||||
@@ -383,6 +383,7 @@ static bool input_pointer_frame_pos(unsigned port, unsigned device,
|
||||
return false;
|
||||
}
|
||||
|
||||
#ifdef HAVE_OVERLAY
|
||||
/* Finger @idx of the pointer @port reads as @device (RETRO_DEVICE_POINTER
|
||||
* or RARCH_DEVICE_POINTER_SCREEN), down or not and where, packed, at one
|
||||
* look: what reading PRESSED, X and Y in turn gives. 1 down, 0 not; -1
|
||||
@@ -406,6 +407,7 @@ static int input_pointer_frame_finger(unsigned port, unsigned device,
|
||||
*pos = (device == RARCH_DEVICE_POINTER_SCREEN) ? screen_pos : vp_pos;
|
||||
return down ? 1 : 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
/* One value of a mouse, a pointer or a lightgun's aim. False if the
|
||||
* frontend does not hold it and the driver is to be asked. */
|
||||
|
||||
@@ -403,6 +403,7 @@ static void xxh3_stripe_scalar(uint64_t *a, const uint8_t *p,
|
||||
XXH3_LANE(4); XXH3_LANE(5); XXH3_LANE(6); XXH3_LANE(7);
|
||||
}
|
||||
|
||||
#if !defined(XXH3_HAVE_NEON)
|
||||
static uint64_t xxh3_long_scalar(const uint8_t *in, size_t len, uint64_t seed)
|
||||
{
|
||||
const size_t total = len;
|
||||
@@ -433,6 +434,7 @@ static uint64_t xxh3_long_scalar(const uint8_t *in, size_t len, uint64_t seed)
|
||||
xxh3_stripe_scalar(acc, in + len - XXH3_STRIPE, sec + XXH3_LAST_KEY);
|
||||
return xxh3_merge_sec(acc, sec, total);
|
||||
}
|
||||
#endif
|
||||
|
||||
/* ---- a stripe at a time, for xxh3_update() ----
|
||||
*
|
||||
|
||||
@@ -623,6 +623,7 @@ static int audio_transfer_time_add(int64_t a, int64_t b, int64_t *out)
|
||||
return 1;
|
||||
}
|
||||
|
||||
#if defined(HAVE_RWEBM) || (defined(HAVE_RAAC) && defined(HAVE_RMP4))
|
||||
static int audio_transfer_time_frames(int64_t ns, unsigned rate, int64_t *out)
|
||||
{
|
||||
const int64_t maximum = (int64_t)((~(uint64_t)0) >> 1);
|
||||
@@ -644,6 +645,7 @@ static int audio_transfer_time_packet(struct audio_transfer_time *t,
|
||||
t->continued = continued;
|
||||
return 1;
|
||||
}
|
||||
#endif
|
||||
|
||||
static int audio_transfer_time_map(struct audio_transfer_time *t,
|
||||
size_t skip, size_t frames)
|
||||
@@ -1978,6 +1980,7 @@ static int audio_transfer_vorbis_movie_fill(struct audio_transfer_vorbis *v, int
|
||||
return 1;
|
||||
}
|
||||
|
||||
#ifdef HAVE_RWEBM
|
||||
/* Header-only contribution in the original decoder sequence. A seek's
|
||||
* priming packet still occupies that sequence even though decoding it
|
||||
* after reset produces no PCM. */
|
||||
@@ -1994,6 +1997,7 @@ static int audio_transfer_vorbis_movie_header(struct audio_transfer_vorbis *v,
|
||||
|| !audio_transfer_time_add(v->emitted, frames, &v->emitted)) return -1;
|
||||
return frames;
|
||||
}
|
||||
#endif
|
||||
|
||||
static int audio_transfer_vorbis_movie_read(struct audio_transfer_vorbis *v,
|
||||
int s16, int16_t *out16, float *outf, size_t frames, size_t *got)
|
||||
@@ -4869,6 +4873,7 @@ static int audio_transfer_opus_movie_read(struct audio_transfer_opus *op,
|
||||
return produced || op->wall || op->yielded ? AUDIO_PROCESS_NEXT : AUDIO_PROCESS_END;
|
||||
}
|
||||
|
||||
#ifdef HAVE_RWEBM
|
||||
static int audio_transfer_opus_movie_header(struct audio_transfer_opus *op,
|
||||
const uint8_t *packet, uint32_t size, int64_t pad)
|
||||
{
|
||||
@@ -4893,6 +4898,7 @@ static int audio_transfer_opus_movie_header(struct audio_transfer_opus *op,
|
||||
return (int)frames;
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_RAAC
|
||||
/* The next access unit, wherever this context's come from. Returns 1
|
||||
@@ -5061,6 +5067,7 @@ static void audio_transfer_aac_to_head(struct audio_transfer_aac *ac)
|
||||
audio_transfer_aac_withdraw_bound(ac);
|
||||
}
|
||||
|
||||
#ifdef HAVE_RWEBM
|
||||
static int audio_transfer_aac_movie_header(struct audio_transfer_aac *ac)
|
||||
{
|
||||
size_t frames = raac_frame_len(ac->handle);
|
||||
@@ -5078,6 +5085,7 @@ static int audio_transfer_aac_movie_header(struct audio_transfer_aac *ac)
|
||||
|| !audio_transfer_time_add(ac->emitted, (int64_t)frames, &ac->emitted)) return -1;
|
||||
return (int)frames;
|
||||
}
|
||||
#endif
|
||||
|
||||
static int audio_transfer_aac_fill(struct audio_transfer_aac *ac);
|
||||
|
||||
|
||||
@@ -734,7 +734,8 @@ int net_http_urldecode(char *dst, size_t dst_size, const char *src)
|
||||
|
||||
int net_http_urldecode_inplace(char *s)
|
||||
{
|
||||
return string_percent_decode(s, (size_t)-1, s);
|
||||
/* Decoding never grows the string, so its own size is the bound */
|
||||
return string_percent_decode(s, strlen(s) + 1, s);
|
||||
}
|
||||
|
||||
/* Base64 "user:pass" for Basic auth, from a URL's userinfo. */
|
||||
@@ -748,7 +749,7 @@ static char *net_http_basic_auth(const char *userinfo, size_t len)
|
||||
return NULL;
|
||||
memcpy(raw, userinfo, len);
|
||||
raw[len] = '\0';
|
||||
out = base64(raw, net_http_urldecode_inplace(raw), &flen);
|
||||
out = base64(raw, string_percent_decode(raw, len + 1, raw), &flen);
|
||||
free(raw);
|
||||
return out;
|
||||
}
|
||||
|
||||
@@ -8767,6 +8767,7 @@ static size_t setting_get_string_representation_input_rotation(
|
||||
return strlcpy(s, msg_hash_to_str(e), len);
|
||||
}
|
||||
|
||||
#ifdef HAVE_OVERLAY
|
||||
static size_t setting_get_string_representation_overlay_contact_method(
|
||||
rarch_setting_t *setting, char *s, size_t len)
|
||||
{
|
||||
@@ -8784,6 +8785,7 @@ static size_t setting_get_string_representation_overlay_contact_method(
|
||||
}
|
||||
return strlcpy(s, msg_hash_to_str(e), len);
|
||||
}
|
||||
#endif
|
||||
|
||||
static size_t setting_get_string_representation_socd(
|
||||
rarch_setting_t *setting, char *s, size_t len)
|
||||
|
||||
@@ -3980,13 +3980,13 @@ void MainWindow::saveDockLayout()
|
||||
* the default tabbing / splits are undone and rebuilt from the rows),
|
||||
* tabbed onto their saved partner, sized, and the saved tab raised. */
|
||||
/* The usable area of the screen a point falls on, for placing windows
|
||||
* and docks. QScreen and QGuiApplication are Qt 5; QDesktopWidget is
|
||||
* Qt 4 and Qt 5 and gone in Qt 6. This is the one place the companion
|
||||
* asks which screen a point is on, so it is the one place that knows
|
||||
* which Qt it is built against. */
|
||||
* and docks. QGuiApplication::screenAt is Qt 5.10 and later; older Qt
|
||||
* asks QDesktopWidget, which is deprecated from 5.10 and gone in Qt 6.
|
||||
* This is the one place the companion asks which screen a point is on,
|
||||
* so it is the one place that knows which Qt it is built against. */
|
||||
static QRect ui_qt_available_geometry_at(const QPoint &p)
|
||||
{
|
||||
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
|
||||
#if QT_VERSION >= QT_VERSION_CHECK(5, 10, 0)
|
||||
QScreen *screen = QGuiApplication::screenAt(p);
|
||||
if (!screen)
|
||||
screen = QGuiApplication::primaryScreen();
|
||||
@@ -5173,10 +5173,9 @@ static void* ui_companion_qt_init(void)
|
||||
handle);
|
||||
qt_companion_core = handle->core;
|
||||
|
||||
/* The usable area of the primary screen, asked for the way the rest
|
||||
* of this file asks: QScreen is Qt 5 and later, QDesktopWidget is
|
||||
* Qt 4 and Qt 5 and gone in Qt 6. */
|
||||
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
|
||||
/* The usable area of the primary screen: QScreen is Qt 5 and later,
|
||||
* QDesktopWidget is for Qt 4. */
|
||||
#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)
|
||||
{
|
||||
QScreen *screen = QGuiApplication::primaryScreen();
|
||||
if (screen)
|
||||
|
||||
Reference in new issue
Block a user