summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsfan5 <sfan5@live.de>2024-03-17 18:21:09 +0100
committersfan5 <sfan5@live.de>2024-03-17 20:04:04 +0100
commitead9f892b3dbe6999b625b6ce3e01c50e59ee69a (patch)
tree213108dc6b7158a74f13326b9fd0528523e72381
parent23c988b3e10b4ff8158178a3f3c4767e65cbcf68 (diff)
downloadmpv-ead9f892b3dbe6999b625b6ce3e01c50e59ee69a.tar.bz2
mpv-ead9f892b3dbe6999b625b6ce3e01c50e59ee69a.tar.xz
various: use static assertions where appropriate
-rw-r--r--audio/out/ao_coreaudio_exclusive.c2
-rw-r--r--options/m_option.c2
-rw-r--r--osdep/io.c2
-rw-r--r--stream/stream_dvdnav.c2
-rw-r--r--sub/osd.c2
5 files changed, 5 insertions, 5 deletions
diff --git a/audio/out/ao_coreaudio_exclusive.c b/audio/out/ao_coreaudio_exclusive.c
index d4e66b73e3..5e0ec3b19f 100644
--- a/audio/out/ao_coreaudio_exclusive.c
+++ b/audio/out/ao_coreaudio_exclusive.c
@@ -114,7 +114,7 @@ static OSStatus enable_property_listener(struct ao *ao, bool enabled)
kAudioHardwarePropertyDevices};
AudioDeviceID devs[] = {p->device,
kAudioObjectSystemObject};
- assert(MP_ARRAY_SIZE(selectors) == MP_ARRAY_SIZE(devs));
+ static_assert(MP_ARRAY_SIZE(selectors) == MP_ARRAY_SIZE(devs), "");
OSStatus status = noErr;
for (int n = 0; n < MP_ARRAY_SIZE(devs); n++) {
diff --git a/options/m_option.c b/options/m_option.c
index 02dea2bf3c..66d68398f4 100644
--- a/options/m_option.c
+++ b/options/m_option.c
@@ -3792,7 +3792,7 @@ static void dup_node(void *ta_parent, struct mpv_node *node)
static void copy_node(const m_option_t *opt, void *dst, const void *src)
{
- assert(sizeof(struct mpv_node) <= sizeof(union m_option_value));
+ static_assert(sizeof(struct mpv_node) <= sizeof(union m_option_value), "");
if (!(dst && src))
return;
diff --git a/osdep/io.c b/osdep/io.c
index d66160c0e7..4306a04a6d 100644
--- a/osdep/io.c
+++ b/osdep/io.c
@@ -189,7 +189,7 @@ static bool get_file_ids_win8(HANDLE h, dev_t *dev, ino_t *ino)
// SDK, but we can ignore that by just memcpying it. This will also
// truncate the file ID on 32-bit Windows, which doesn't support __int128.
// 128-bit file IDs are only used for ReFS, so that should be okay.
- assert(sizeof(*ino) <= sizeof(ii.FileId));
+ static_assert(sizeof(*ino) <= sizeof(ii.FileId), "");
memcpy(ino, &ii.FileId, sizeof(*ino));
return true;
}
diff --git a/stream/stream_dvdnav.c b/stream/stream_dvdnav.c
index d858c51aca..5dba92ada5 100644
--- a/stream/stream_dvdnav.c
+++ b/stream/stream_dvdnav.c
@@ -497,7 +497,7 @@ static int control(stream_t *stream, int cmd, void *arg)
struct stream_dvd_info_req *req = arg;
memset(req, 0, sizeof(*req));
req->num_subs = mp_dvdnav_number_of_subs(stream);
- assert(sizeof(uint32_t) == sizeof(unsigned int));
+ static_assert(sizeof(uint32_t) == sizeof(unsigned int), "");
memcpy(req->palette, priv->spu_clut, sizeof(req->palette));
return STREAM_OK;
}
diff --git a/sub/osd.c b/sub/osd.c
index 9d6926dcb6..d33aabdd53 100644
--- a/sub/osd.c
+++ b/sub/osd.c
@@ -119,7 +119,7 @@ bool osd_res_equals(struct mp_osd_res a, struct mp_osd_res b)
struct osd_state *osd_create(struct mpv_global *global)
{
- assert(MAX_OSD_PARTS >= OSDTYPE_COUNT);
+ static_assert(MAX_OSD_PARTS >= OSDTYPE_COUNT, "");
struct osd_state *osd = talloc_zero(NULL, struct osd_state);
*osd = (struct osd_state) {