Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Makefile.emscripten
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@ endif
ifeq ($(DEBUG), 1)
LDFLAGS += -O0 -g -gsource-map -s STACK_OVERFLOW_CHECK=2
# -O0 in cflags gives "too many locals" errors
CFLAGS += -O1 -g -gsource-map
CFLAGS += -O1 -g -gsource-map -Wall -Werror
override ASSERTIONS = 1
# "WASM_WORKERS is not currently compatible with `-fsanitize` tools"
ifeq ($(WASM_WORKERS), 0)
Expand Down
15 changes: 12 additions & 3 deletions audio/common/pipewire.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,11 @@ static void core_error_cb(void *data, uint32_t id, int seq, int res, const char
{
pipewire_core_t *pw = (pipewire_core_t*)data;

#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wpedantic"
RARCH_ERR("[PipeWire] Error id:%u seq:%d res:%d (%s): %s.\n",
id, seq, res, spa_strerror(res), message);

#pragma GCC diagnostic pop
pw_thread_loop_stop(pw->thread_loop);
}

Expand All @@ -54,8 +56,10 @@ static const struct pw_core_events core_events = {
void pipewire_core_wait_resync(pipewire_core_t *pw)
{
retro_assert(pw);
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wpedantic"
pw->pending_seq = pw_core_sync(pw->core, PW_ID_CORE, pw->pending_seq);

#pragma GCC diagnostic pop
for (;;)
{
pw_thread_loop_wait(pw->thread_loop);
Expand Down Expand Up @@ -116,16 +120,21 @@ bool pipewire_core_init(pipewire_core_t **pw, const char *loop_name, const struc
if (!(*pw)->core)
goto unlock;

#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wpedantic"
if (pw_core_add_listener((*pw)->core,
&(*pw)->core_listener,
&core_events, *pw) < 0)
goto unlock;

#pragma GCC diagnostic pop
if (events)
{
(*pw)->registry = pw_core_get_registry((*pw)->core, PW_VERSION_REGISTRY, 0);
spa_zero((*pw)->registry_listener);
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wpedantic"
pw_registry_add_listener((*pw)->registry, &(*pw)->registry_listener, events, *pw);
#pragma GCC diagnostic pop
}

return true;
Expand Down
4 changes: 3 additions & 1 deletion audio/common/pipewire.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,12 @@
#define _RETROARCH_PIPEWIRE

#include <stdint.h>

#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wpedantic"
#include <spa/param/audio/format-utils.h>
#include <spa/utils/ringbuffer.h>
#include <pipewire/pipewire.h>
#pragma GCC diagnostic pop

#include <lists/string_list.h>

Expand Down
2 changes: 1 addition & 1 deletion audio/drivers/alsathread.c
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ static int alsa_thread_microphone_read(void *driver_context, void *mic_context,
{
snd_pcm_state_t state;
size_t _len = 0;
uint8_t *s = (uint8_t*)sv;
uint8_t *s = (uint8_t *)sv;
alsa_thread_microphone_t *alsa = (alsa_thread_microphone_t*)driver_context;
alsa_thread_microphone_handle_t *mic = (alsa_thread_microphone_handle_t*)mic_context;

Expand Down
14 changes: 12 additions & 2 deletions audio/drivers/pipewire.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,14 @@
* You should have received a copy of the GNU General Public License along with RetroArch.
* If not, see <http://www.gnu.org/licenses/>.
*/

#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wpedantic"
#include <spa/param/audio/format-utils.h>
#include <spa/utils/ringbuffer.h>
#include <spa/utils/result.h>
#include <spa/param/props.h>
#include <pipewire/pipewire.h>
#pragma GCC diagnostic pop

#include <boolean.h>
#include <retro_miscellaneous.h>
Expand Down Expand Up @@ -220,8 +222,10 @@ static void *pwire_microphone_init(void)
struct pw_properties *props = NULL;
const char *error = NULL;
pipewire_core_t *pw = NULL;
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wpedantic"
struct spa_pod_builder b = SPA_POD_BUILDER_INIT(buffer, sizeof(buffer));

#pragma GCC diagnostic pop
if (!pipewire_core_init(&pw, "microphone_driver", &pwire_mic_registry_events))
goto error;

Expand Down Expand Up @@ -340,7 +344,10 @@ static void *pwire_microphone_open_mic(void *driver_context,
const struct spa_pod *params[1];
struct pw_properties *props = NULL;
const char *error = NULL;
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wpedantic"
struct spa_pod_builder b = SPA_POD_BUILDER_INIT(buffer, sizeof(buffer));
#pragma GCC diagnostic pop
pipewire_microphone_t *mic = NULL;

if (!driver_context || (mic = calloc(1, sizeof(pipewire_microphone_t))) == NULL)
Expand Down Expand Up @@ -604,7 +611,10 @@ static void *pwire_init(const char *device, unsigned rate,
struct pw_properties *props = NULL;
const char *error = NULL;
pipewire_audio_t *audio = (pipewire_audio_t*)calloc(1, sizeof(*audio));
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wpedantic"
struct spa_pod_builder b = SPA_POD_BUILDER_INIT(buffer, sizeof(buffer));
#pragma GCC diagnostic pop

if (!audio)
return NULL;
Expand Down
19 changes: 16 additions & 3 deletions camera/drivers/pipewire.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
* If not, see <http://www.gnu.org/licenses/>.
*/

#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wpedantic"
#include <spa/utils/result.h>
#include <spa/param/video/format-utils.h>
#include <spa/param/tag-utils.h>
Expand All @@ -21,6 +23,7 @@
#include <spa/debug/format.h>
#include <spa/debug/pod.h>
#include <pipewire/pipewire.h>
#pragma GCC diagnostic pop

#include <gfx/scaler/scaler.h>
#include <gfx/video_frame.h>
Expand Down Expand Up @@ -209,8 +212,10 @@ static void stream_param_changed_cb(void *data, uint32_t id, const struct spa_po
uint8_t params_buffer[1024];
const struct spa_pod *params[5];
pipewire_camera_t *camera = (pipewire_camera_t*)data;
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wpedantic"
struct spa_pod_builder b = SPA_POD_BUILDER_INIT(params_buffer, sizeof(params_buffer));

#pragma GCC diagnostic pop
if (param && id == SPA_PARAM_Tag)
{
spa_debug_pod(0, NULL, param);
Expand Down Expand Up @@ -258,6 +263,8 @@ static void stream_param_changed_cb(void *data, uint32_t id, const struct spa_po
return;
}

#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wpedantic"
struct spa_pod_frame frame;
spa_pod_builder_push_object(&b, &frame, SPA_TYPE_OBJECT_ParamBuffers, SPA_PARAM_Buffers);
spa_pod_builder_add(&b,
Expand All @@ -270,7 +277,6 @@ static void stream_param_changed_cb(void *data, uint32_t id, const struct spa_po
0);

params[0] = spa_pod_builder_pop(&b, &frame);

params[1] = spa_pod_builder_add_object(&b,
SPA_TYPE_OBJECT_ParamMeta, SPA_PARAM_Meta,
SPA_PARAM_META_type, SPA_POD_Id(SPA_META_Header),
Expand All @@ -281,6 +287,7 @@ static void stream_param_changed_cb(void *data, uint32_t id, const struct spa_po
SPA_PARAM_META_type, SPA_POD_Id(SPA_META_VideoTransform),
SPA_PARAM_META_size, SPA_POD_Int(sizeof(struct spa_meta_videotransform)));
#endif
#pragma GCC diagnostic pop

camera->buffer_output = (uint32_t *)
malloc(camera->size.width * camera->size.height * sizeof(uint32_t));
Expand Down Expand Up @@ -372,8 +379,11 @@ static void *pipewire_init(const char *device, uint64_t caps,
struct pw_properties *props;
uint8_t buffer[1024];
pipewire_camera_t *camera = (pipewire_camera_t*)calloc(1, sizeof(*camera));
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wpedantic"
struct spa_pod_builder b = SPA_POD_BUILDER_INIT(buffer, sizeof(buffer));

#pragma GCC diagnostic pop

if (!camera)
goto error;

Expand Down Expand Up @@ -420,7 +430,10 @@ static void *pipewire_init(const char *device, uint64_t caps,

if (res < 0)
{
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wpedantic"
RARCH_ERR("[Camera] [PipeWire] Can't connect: %s.\n", spa_strerror(res));
#pragma GCC diagnostic pop
goto error;
}

Expand Down
1 change: 0 additions & 1 deletion gfx/common/wayland_common.c
Original file line number Diff line number Diff line change
Expand Up @@ -660,7 +660,6 @@ static void shm_buffer_paint_checkerboard(
}
}
}

static bool wl_draw_splash_screen(gfx_ctx_wayland_data_t *wl)
{
if (wl->single_pixel_manager)
Expand Down
1 change: 1 addition & 0 deletions gfx/video_crt_switch.c
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,7 @@ static bool crt_sr2_init(videocrt_switch_t *p_switch,
void (*dbgp)(const char *, ...) = &RARCH_DBG;
void (*errp)(const char *, ...) = &RARCH_ERR;
sr_init();

sr_set_log_callback_info(*(void **)(&logp));
sr_set_log_callback_debug(*(void **)(&dbgp));
sr_set_log_callback_error(*(void **)(&errp));
Expand Down
3 changes: 3 additions & 0 deletions input/bsv/uint32s_index.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,10 @@ uint32s_index_t *uint32s_index_new(size_t object_size,
uint32s_index_t *index = (uint32s_index_t *)malloc(sizeof(uint32s_index_t));
index->object_size = object_size;
index->index = NULL;
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wtautological-compare"
RHMAP_FIT(index->index, HASHMAP_CAP);
#pragma GCC diagnostic pop
index->objects = NULL;
index->counts = NULL;
index->hashes = NULL;
Expand Down
5 changes: 5 additions & 0 deletions libretro-common/net/cacert.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
* https://curl.haxx.se/docs/caextract.html
* NOTE: Newlines are necessary for the file to be parsed correctly!
*/
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Woverlength-strings"

static const char cacert_pem[] = {
"##\n"
"## Bundle of CA Root Certificates\n"
Expand Down Expand Up @@ -3803,3 +3806,5 @@ static const char cacert_pem[] = {
"q5Rm+K37DwhuJi1/FwcJsoz7UMCflo3Ptv0AnVoUmr8CRPXBwp8iXqIPoeM=\n"
"-----END CERTIFICATE-----\n"
};

#pragma GCC diagnostic pop
4 changes: 2 additions & 2 deletions tasks/task_autodetect.c
Original file line number Diff line number Diff line change
Expand Up @@ -509,8 +509,8 @@ static void reallocate_port_if_needed(
|| string_is_equal(device_display_name, settings_value_device_name);
}
else
device_has_reserved_slot = ( vendor_id == settings_value_vendor_id
&& product_id == settings_value_product_id);
device_has_reserved_slot = ( vendor_id == (int)settings_value_vendor_id
&& product_id == (int)settings_value_product_id);

if (device_has_reserved_slot)
{
Expand Down
Loading