summaryrefslogtreecommitdiffstats
path: root/options
diff options
context:
space:
mode:
authorChristoph Heinrich <christoph.heinrich@student.tugraz.at>2023-02-26 17:28:50 +0100
committersfan5 <sfan5@live.de>2023-02-27 11:21:49 +0100
commitc5265381b555766a9d1f931c5371b987292ee41a (patch)
treef7802abfcb18a8d605e1e5ef9ca9c6ac544a0a5b /options
parenta265da9f25ed613212a00b8143a9b6f76d341440 (diff)
downloadmpv-c5265381b555766a9d1f931c5371b987292ee41a.tar.bz2
mpv-c5265381b555766a9d1f931c5371b987292ee41a.tar.xz
client API: reintroduce CONF_TYPE_FLAG for type conversion
Changing the CONF_TYPE_FLAG was a bad idea because mpv_node.u.flag continues to be an int, leading to a mismatch in type sizes which can lead to problems with memcpy(). ref. #11373 This partially reverts commit 17d91b9d4d2d208f4a847395198cdbbcad18de93.
Diffstat (limited to 'options')
-rw-r--r--options/m_option.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/options/m_option.h b/options/m_option.h
index f179c75494..bcdc1f9fcc 100644
--- a/options/m_option.h
+++ b/options/m_option.h
@@ -213,6 +213,7 @@ struct m_sub_options {
};
#define CONF_TYPE_BOOL (&m_option_type_bool)
+#define CONF_TYPE_FLAG (&m_option_type_flag)
#define CONF_TYPE_INT (&m_option_type_int)
#define CONF_TYPE_INT64 (&m_option_type_int64)
#define CONF_TYPE_FLOAT (&m_option_type_float)
@@ -232,6 +233,7 @@ struct m_sub_options {
// size/alignment requirements for option values in general.
union m_option_value {
bool bool_;
+ int flag; // not the C type "bool"!
int int_;
int64_t int64;
float float_;