Those casts were usually used to workaround switch warnings. Also adds default to OBS frontend event switches that had this workaround.
@@ -636,7 +636,7 @@ void SourceTreeModel::OBSFrontendEvent(enum obs_frontend_event event, void *ptr)
{
SourceTreeModel *stm = reinterpret_cast<SourceTreeModel *>(ptr);
- switch ((int)event) {
+ switch (event) {
case OBS_FRONTEND_EVENT_PREVIEW_SCENE_CHANGED:
stm->SceneChanged();
break;
@@ -644,6 +644,8 @@ void SourceTreeModel::OBSFrontendEvent(enum obs_frontend_event event, void *ptr)
case OBS_FRONTEND_EVENT_SCENE_COLLECTION_CLEANUP:
stm->Clear();
+ default:
+ break;
}
@@ -22,13 +22,15 @@ void OBSBasicStats::OBSFrontendEvent(enum obs_frontend_event event, void *ptr)
OBSBasicStats *stats = reinterpret_cast<OBSBasicStats *>(ptr);
case OBS_FRONTEND_EVENT_RECORDING_STARTED:
stats->StartRecTimeLeft();
case OBS_FRONTEND_EVENT_RECORDING_STOPPED:
stats->ResetRecTimeLeft();
@@ -735,7 +735,7 @@ void gs_shader_set_val(gs_sparam_t *param, const void *val, size_t size)
if (!count)
count = 1;
- switch ((uint32_t)param->type) {
+ switch (param->type) {
case GS_SHADER_PARAM_FLOAT:
expected_size = sizeof(float);
@@ -617,7 +617,7 @@ void gs_free_image_deps(void) {}
static inline enum gs_color_format convert_format(enum AVPixelFormat format)
- switch ((int)format) {
+ switch (format) {
case AV_PIX_FMT_RGBA:
return GS_RGBA;
case AV_PIX_FMT_BGRA:
@@ -56,7 +56,7 @@ static inline void calc_gpu_conversion_sizes(struct obs_core_video_mix *video)
video->conversion_width_i = 0.f;
video->conversion_height_i = 0.f;
- switch ((uint32_t)info->format) {
+ switch (info->format) {
case VIDEO_FORMAT_I420:
video->conversion_needed = true;
video->conversion_techs[0] = "Planar_Y";
@@ -98,7 +98,7 @@ determine_chroma_location(enum AVPixelFormat pix_fmt,
static inline enum audio_format
convert_ffmpeg_sample_format(enum AVSampleFormat format)
- switch ((uint32_t)format) {
case AV_SAMPLE_FMT_U8:
return AUDIO_FORMAT_U8BIT;
case AV_SAMPLE_FMT_S16: