Skip to content

Commit

Permalink
enable & fix some warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
ardera committed Sep 16, 2024
1 parent 615d537 commit 0f59af4
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 1 deletion.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ target_include_directories(flutterpi_module PUBLIC
)

target_compile_options(flutterpi_module PUBLIC
$<$<CONFIG:Debug>:-O0 -Wall -Wextra -Wno-sign-compare -Werror -ggdb -U_FORTIFY_SOURCE -DDEBUG>
$<$<CONFIG:Debug>:-O0 -Wall -Wextra -Wno-sign-compare -Wswitch-enum -Wformat -Wdouble-promotion -Werror -ggdb -U_FORTIFY_SOURCE -DDEBUG>
$<$<CONFIG:RelWithDebInfo>:-O3 -Wall -Wextra -Wno-sign-compare -ggdb -DNDEBUG>
$<$<CONFIG:Release>:-O3 -Wall -Wextra -Wno-sign-compare -DNDEBUG>
)
Expand Down
4 changes: 4 additions & 0 deletions src/plugins/audioplayers/player.c
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,9 @@ struct audio_player *audio_player_new(char *player_id, char *channel) {

gboolean audio_player_on_bus_message(GstBus *bus, GstMessage *message, struct audio_player *data) {
(void) bus;

PRAGMA_DIAGNOSTIC_PUSH
PRAGMA_DIAGNOSTIC_IGNORED("-Wswitch-enum")
switch (GST_MESSAGE_TYPE(message)) {
case GST_MESSAGE_ERROR: {
GError *err;
Expand Down Expand Up @@ -214,6 +217,7 @@ gboolean audio_player_on_bus_message(GstBus *bus, GstMessage *message, struct au
// https://gstreamer.freedesktop.org/documentation/gstreamer/gstmessage.html?gi-language=c#enumerations
break;
}
PRAGMA_DIAGNOSTIC_POP

// Continue watching for messages
return TRUE;
Expand Down
3 changes: 3 additions & 0 deletions src/plugins/gstreamer_video_player/frame.c
Original file line number Diff line number Diff line change
Expand Up @@ -697,6 +697,8 @@ get_plane_infos(GstBuffer *buffer, const GstVideoInfo *info, struct gbm_device *
}

static uint32_t drm_format_from_gst_info(const GstVideoInfo *info) {
PRAGMA_DIAGNOSTIC_PUSH
PRAGMA_DIAGNOSTIC_IGNORED("-Wswitch-enum")
switch (GST_VIDEO_INFO_FORMAT(info)) {
case GST_VIDEO_FORMAT_YUY2: return DRM_FORMAT_YUYV;
case GST_VIDEO_FORMAT_YVYU: return DRM_FORMAT_YVYU;
Expand Down Expand Up @@ -730,6 +732,7 @@ static uint32_t drm_format_from_gst_info(const GstVideoInfo *info) {
case GST_VIDEO_FORMAT_xBGR: return DRM_FORMAT_RGBX8888;
default: return DRM_FORMAT_INVALID;
}
PRAGMA_DIAGNOSTIC_POP
}

ATTR_CONST GstVideoFormat gst_video_format_from_drm_format(uint32_t drm_format) {
Expand Down
5 changes: 5 additions & 0 deletions src/plugins/gstreamer_video_player/player.c
Original file line number Diff line number Diff line change
Expand Up @@ -472,6 +472,9 @@ static void on_bus_message(struct gstplayer *player, GstMessage *msg) {
gchar *debug_info;

DEBUG_TRACE_BEGIN(player, "on_bus_message");

PRAGMA_DIAGNOSTIC_PUSH
PRAGMA_DIAGNOSTIC_IGNORED("-Wswitch-enum")
switch (GST_MESSAGE_TYPE(msg)) {
case GST_MESSAGE_ERROR:
gst_message_parse_error(msg, &error, &debug_info);
Expand Down Expand Up @@ -604,6 +607,8 @@ static void on_bus_message(struct gstplayer *player, GstMessage *msg) {

default: LOG_DEBUG("gstreamer message: %s, src: %s\n", GST_MESSAGE_TYPE_NAME(msg), GST_MESSAGE_SRC_NAME(msg)); break;
}
PRAGMA_DIAGNOSTIC_POP

DEBUG_TRACE_END(player, "on_bus_message");
return;
}
Expand Down
1 change: 1 addition & 0 deletions src/vulkan.h
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ static inline const char *vk_strerror(VkResult result) {
#if VK_HEADER_VERSION >= 213
case VK_ERROR_COMPRESSION_EXHAUSTED_EXT: return "VK_ERROR_COMPRESSION_EXHAUSTED_EXT";
#endif
case VK_RESULT_MAX_ENUM:
default: return "<unknown result code>";
}
}
Expand Down

0 comments on commit 0f59af4

Please sign in to comment.