From b5d50c42439818292be750cf6c45d6eb8d47c483 Mon Sep 17 00:00:00 2001 From: tytan652 Date: Tue, 26 Jul 2022 21:16:27 +0200 Subject: [PATCH] lib,requesthandler,eventhandler: Fix C4244 & C4334 warnings --- lib/obs-websocket-api.h | 2 +- src/eventhandler/EventHandler_Inputs.cpp | 2 +- src/requesthandler/RequestHandler_Inputs.cpp | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/obs-websocket-api.h b/lib/obs-websocket-api.h index 3ab1a623..503eb53f 100644 --- a/lib/obs-websocket-api.h +++ b/lib/obs-websocket-api.h @@ -96,7 +96,7 @@ static inline unsigned int obs_websocket_get_api_version(void) if (!proc_handler_call(_ph, "get_api_version", &cd)) return 1; // API v1 does not include get_api_version - unsigned int ret = calldata_int(&cd, "version"); + unsigned int ret = (unsigned int)calldata_int(&cd, "version"); calldata_free(&cd); diff --git a/src/eventhandler/EventHandler_Inputs.cpp b/src/eventhandler/EventHandler_Inputs.cpp index 2c27d79b..c677785f 100644 --- a/src/eventhandler/EventHandler_Inputs.cpp +++ b/src/eventhandler/EventHandler_Inputs.cpp @@ -225,7 +225,7 @@ void EventHandler::HandleInputVolumeChanged(void *param, calldata_t *data) // Volume must be grabbed from the calldata. Running obs_source_get_volume() will return the previous value. double inputVolumeMul = calldata_float(data, "volume"); - double inputVolumeDb = obs_mul_to_db(inputVolumeMul); + double inputVolumeDb = obs_mul_to_db((float)inputVolumeMul); if (inputVolumeDb == -INFINITY) inputVolumeDb = -100; diff --git a/src/requesthandler/RequestHandler_Inputs.cpp b/src/requesthandler/RequestHandler_Inputs.cpp index fea567fc..7390fc8a 100644 --- a/src/requesthandler/RequestHandler_Inputs.cpp +++ b/src/requesthandler/RequestHandler_Inputs.cpp @@ -820,9 +820,9 @@ RequestResult RequestHandler::SetInputAudioTracks(const Request &request) json inputAudioTracks = request.RequestData["inputAudioTracks"]; - long long mixers = obs_source_get_audio_mixers(input); + uint32_t mixers = obs_source_get_audio_mixers(input); - for (long long i = 0; i < MAX_AUDIO_MIXES; i++) { + for (uint32_t i = 0; i < MAX_AUDIO_MIXES; i++) { std::string track = std::to_string(i + 1); if (!Utils::Json::Contains(inputAudioTracks, track))