From d7848f3cb747fda53893dfea147b4d631e018bbe Mon Sep 17 00:00:00 2001 From: jp9000 Date: Sun, 15 Nov 2015 09:43:39 -0800 Subject: [PATCH] libobs: Fix "possible loss of data" warning Fixes the following warning of MSVC: warning C4244: '=' : conversion from '__int64' to 'uint32_t', possible loss of data --- libobs/obs-data.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/libobs/obs-data.c b/libobs/obs-data.c index 347515ffd..82b8c2fc2 100644 --- a/libobs/obs-data.c +++ b/libobs/obs-data.c @@ -2070,10 +2070,11 @@ static inline bool get_frames_per_second(obs_data_t *data, goto free; } - fps->numerator = - CLAMP(obs_data_item_get_int(num), 0, UINT32_MAX); - fps->denominator = - CLAMP(obs_data_item_get_int(den), 0, UINT32_MAX); + uint32_t num_uint32 = (uint32_t)obs_data_item_get_int(num); + uint32_t den_uint32 = (uint32_t)obs_data_item_get_int(den); + + fps->numerator = CLAMP(num_uint32, 0, UINT32_MAX); + fps->denominator = CLAMP(den_uint32, 0, UINT32_MAX); obs_data_item_release(&num); obs_data_item_release(&den);