mirror of
https://github.com/dslm4515/BMLFS.git
synced 2025-08-20 14:31:47 +00:00
219 lines
6.9 KiB
Diff
219 lines
6.9 KiB
Diff
From 870abdc5c7dbb3327a926529ea6e0048237b2036 Mon Sep 17 00:00:00 2001
|
|
From: q66 <q66@chimera-linux.org>
|
|
Date: Tue, 7 Dec 2021 01:43:04 +0100
|
|
Subject: [PATCH] fix a bunch of fallthrough bullshit
|
|
|
|
this code conflicts with libc++ by defining fallthrough keyword
|
|
as macro and everything messes up
|
|
---
|
|
include/compiler.h | 17 -----------------
|
|
utils/cec-compliance/cec-test-audio.cpp | 2 ++
|
|
utils/cec-ctl/cec-ctl.cpp | 2 ++
|
|
utils/cec-follower/cec-follower.cpp | 2 ++
|
|
utils/cec-follower/cec-processing.cpp | 2 ++
|
|
utils/cec-follower/cec-tuner.cpp | 2 ++
|
|
utils/common/v4l2-tpg-core.c | 2 ++
|
|
utils/libcecutil/cec-log.cpp | 2 ++
|
|
utils/v4l2-compliance/v4l2-test-colors.cpp | 2 ++
|
|
utils/v4l2-compliance/v4l2-test-controls.cpp | 2 ++
|
|
utils/v4l2-compliance/v4l2-test-formats.cpp | 2 ++
|
|
utils/v4l2-ctl/v4l2-ctl-edid.cpp | 2 ++
|
|
utils/v4l2-ctl/v4l2-ctl-streaming.cpp | 2 ++
|
|
utils/v4l2-ctl/v4l2-ctl-vbi.cpp | 2 ++
|
|
14 files changed, 26 insertions(+), 17 deletions(-)
|
|
|
|
diff --git a/include/compiler.h b/include/compiler.h
|
|
index 5ad54f41..e69de29b 100644
|
|
--- a/include/compiler.h
|
|
+++ b/include/compiler.h
|
|
@@ -1,17 +0,0 @@
|
|
-#ifdef _LIBCPP_VERSION
|
|
-#define fallthrough _LIBCPP_FALLTHROUGH()
|
|
-#else
|
|
-
|
|
-#if __cplusplus >= 201103L
|
|
-
|
|
-#ifdef __clang__
|
|
-#define fallthrough [[clang::fallthrough]]
|
|
-#else
|
|
-#define fallthrough [[gnu::fallthrough]]
|
|
-#endif // __clang__
|
|
-
|
|
-#else
|
|
-#define fallthrough ((void)0)
|
|
-
|
|
-#endif // __cplusplus
|
|
-#endif // _LIBCPP_VERSION
|
|
diff --git a/utils/cec-compliance/cec-test-audio.cpp b/utils/cec-compliance/cec-test-audio.cpp
|
|
index 611f600f..7d9d0429 100644
|
|
--- a/utils/cec-compliance/cec-test-audio.cpp
|
|
+++ b/utils/cec-compliance/cec-test-audio.cpp
|
|
@@ -13,6 +13,8 @@
|
|
#include "cec-compliance.h"
|
|
#include "compiler.h"
|
|
|
|
+#define fallthrough [[clang::fallthrough]]
|
|
+
|
|
static std::string audio_format_code2s(__u8 format_code)
|
|
{
|
|
switch (format_code) {
|
|
diff --git a/utils/cec-ctl/cec-ctl.cpp b/utils/cec-ctl/cec-ctl.cpp
|
|
index 400e013c..9efe1aa6 100644
|
|
--- a/utils/cec-ctl/cec-ctl.cpp
|
|
+++ b/utils/cec-ctl/cec-ctl.cpp
|
|
@@ -28,6 +28,8 @@
|
|
#include "cec-ctl.h"
|
|
#include "compiler.h"
|
|
|
|
+#define fallthrough [[clang::fallthrough]]
|
|
+
|
|
static struct timespec start_monotonic;
|
|
static struct timeval start_timeofday;
|
|
static time_t valid_until_t;
|
|
diff --git a/utils/cec-follower/cec-follower.cpp b/utils/cec-follower/cec-follower.cpp
|
|
index a7481aea..ab72c44a 100644
|
|
--- a/utils/cec-follower/cec-follower.cpp
|
|
+++ b/utils/cec-follower/cec-follower.cpp
|
|
@@ -14,6 +14,8 @@
|
|
#include "cec-follower.h"
|
|
#include "compiler.h"
|
|
|
|
+#define fallthrough [[clang::fallthrough]]
|
|
+
|
|
/* Short option list
|
|
|
|
Please keep in alphabetical order.
|
|
diff --git a/utils/cec-follower/cec-processing.cpp b/utils/cec-follower/cec-processing.cpp
|
|
index 14ee211b..af838d06 100644
|
|
--- a/utils/cec-follower/cec-processing.cpp
|
|
+++ b/utils/cec-follower/cec-processing.cpp
|
|
@@ -13,6 +13,8 @@
|
|
#include "cec-follower.h"
|
|
#include "compiler.h"
|
|
|
|
+#define fallthrough [[clang::fallthrough]]
|
|
+
|
|
#define VOLUME_MAX 0x64
|
|
#define VOLUME_MIN 0
|
|
|
|
diff --git a/utils/cec-follower/cec-tuner.cpp b/utils/cec-follower/cec-tuner.cpp
|
|
index a2cb6cab..ae7fd6e0 100644
|
|
--- a/utils/cec-follower/cec-tuner.cpp
|
|
+++ b/utils/cec-follower/cec-tuner.cpp
|
|
@@ -11,6 +11,8 @@
|
|
#include "cec-follower.h"
|
|
#include "compiler.h"
|
|
|
|
+#define fallthrough [[clang::fallthrough]]
|
|
+
|
|
#define NUM_ANALOG_FREQS 3
|
|
#define NUM_DIGITAL_CHANS 3
|
|
#define TOT_ANALOG_FREQS analog_freqs_khz[0][0].size()
|
|
diff --git a/utils/common/v4l2-tpg-core.c b/utils/common/v4l2-tpg-core.c
|
|
index b4075bcb..dc1faa13 100644
|
|
--- a/utils/common/v4l2-tpg-core.c
|
|
+++ b/utils/common/v4l2-tpg-core.c
|
|
@@ -11,6 +11,8 @@
|
|
#include "compiler.h"
|
|
#include "v4l2-tpg-colors.h"
|
|
|
|
+#define fallthrough [[clang::fallthrough]]
|
|
+
|
|
/* Must remain in sync with enum tpg_pattern */
|
|
const char * const tpg_pattern_strings[] = {
|
|
"75% Colorbar",
|
|
diff --git a/utils/libcecutil/cec-log.cpp b/utils/libcecutil/cec-log.cpp
|
|
index 0ee63de6..3b176e28 100644
|
|
--- a/utils/libcecutil/cec-log.cpp
|
|
+++ b/utils/libcecutil/cec-log.cpp
|
|
@@ -14,6 +14,8 @@
|
|
#include "cec-log.h"
|
|
#include "compiler.h"
|
|
|
|
+#define fallthrough [[clang::fallthrough]]
|
|
+
|
|
static const struct cec_arg arg_u8 = {
|
|
CEC_ARG_TYPE_U8,
|
|
};
|
|
diff --git a/utils/v4l2-compliance/v4l2-test-colors.cpp b/utils/v4l2-compliance/v4l2-test-colors.cpp
|
|
index 87bf0cd7..5154910f 100644
|
|
--- a/utils/v4l2-compliance/v4l2-test-colors.cpp
|
|
+++ b/utils/v4l2-compliance/v4l2-test-colors.cpp
|
|
@@ -23,6 +23,8 @@
|
|
#include "compiler.h"
|
|
#include "v4l2-compliance.h"
|
|
|
|
+#define fallthrough [[clang::fallthrough]]
|
|
+
|
|
static void setupPlanes(const cv4l_fmt &fmt, __u8 *planes[3])
|
|
{
|
|
if (fmt.g_num_planes() > 1)
|
|
diff --git a/utils/v4l2-compliance/v4l2-test-controls.cpp b/utils/v4l2-compliance/v4l2-test-controls.cpp
|
|
index d7f6be43..46980438 100644
|
|
--- a/utils/v4l2-compliance/v4l2-test-controls.cpp
|
|
+++ b/utils/v4l2-compliance/v4l2-test-controls.cpp
|
|
@@ -29,6 +29,8 @@
|
|
#include "compiler.h"
|
|
#include "v4l2-compliance.h"
|
|
|
|
+#define fallthrough [[clang::fallthrough]]
|
|
+
|
|
static int checkQCtrl(struct node *node, struct test_query_ext_ctrl &qctrl)
|
|
{
|
|
struct v4l2_querymenu qmenu;
|
|
diff --git a/utils/v4l2-compliance/v4l2-test-formats.cpp b/utils/v4l2-compliance/v4l2-test-formats.cpp
|
|
index 8a16613c..91f95c25 100644
|
|
--- a/utils/v4l2-compliance/v4l2-test-formats.cpp
|
|
+++ b/utils/v4l2-compliance/v4l2-test-formats.cpp
|
|
@@ -27,6 +27,8 @@
|
|
#include "compiler.h"
|
|
#include "v4l2-compliance.h"
|
|
|
|
+#define fallthrough [[clang::fallthrough]]
|
|
+
|
|
static constexpr __u32 buftype2cap[] = {
|
|
0,
|
|
V4L2_CAP_VIDEO_CAPTURE | V4L2_CAP_VIDEO_M2M,
|
|
diff --git a/utils/v4l2-ctl/v4l2-ctl-edid.cpp b/utils/v4l2-ctl/v4l2-ctl-edid.cpp
|
|
index c9f827dc..873f2f15 100644
|
|
--- a/utils/v4l2-ctl/v4l2-ctl-edid.cpp
|
|
+++ b/utils/v4l2-ctl/v4l2-ctl-edid.cpp
|
|
@@ -6,6 +6,8 @@
|
|
#include "compiler.h"
|
|
#include "v4l2-ctl.h"
|
|
|
|
+#define fallthrough [[clang::fallthrough]]
|
|
+
|
|
/*
|
|
* The 24-bit IEEE Registration Identifier for the HDMI-LLC Vendor
|
|
* Specific Data Block.
|
|
diff --git a/utils/v4l2-ctl/v4l2-ctl-streaming.cpp b/utils/v4l2-ctl/v4l2-ctl-streaming.cpp
|
|
index 63522e87..e8f75424 100644
|
|
--- a/utils/v4l2-ctl/v4l2-ctl-streaming.cpp
|
|
+++ b/utils/v4l2-ctl/v4l2-ctl-streaming.cpp
|
|
@@ -14,6 +14,8 @@ extern "C" {
|
|
#include "v4l2-tpg.h"
|
|
}
|
|
|
|
+#define fallthrough [[clang::fallthrough]]
|
|
+
|
|
static unsigned stream_count;
|
|
static unsigned stream_skip;
|
|
static __u32 memory = V4L2_MEMORY_MMAP;
|
|
diff --git a/utils/v4l2-ctl/v4l2-ctl-vbi.cpp b/utils/v4l2-ctl/v4l2-ctl-vbi.cpp
|
|
index dc7b4282..4a49d520 100644
|
|
--- a/utils/v4l2-ctl/v4l2-ctl-vbi.cpp
|
|
+++ b/utils/v4l2-ctl/v4l2-ctl-vbi.cpp
|
|
@@ -3,6 +3,8 @@
|
|
#include "compiler.h"
|
|
#include "v4l2-ctl.h"
|
|
|
|
+#define fallthrough [[clang::fallthrough]]
|
|
+
|
|
static struct v4l2_format sliced_fmt; /* set_format/get_format for sliced VBI */
|
|
static struct v4l2_format sliced_fmt_out; /* set_format/get_format for sliced VBI output */
|
|
static struct v4l2_format raw_fmt; /* set_format/get_format for VBI */
|
|
--
|
|
2.43.2
|
|
|