Skip to content

Commit 5650d91

Browse files
committed
Silence warnings
1 parent 74c03d2 commit 5650d91

File tree

4 files changed

+26
-32
lines changed

4 files changed

+26
-32
lines changed

audio/drivers/coreaudio_mic_macos.m

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -285,12 +285,11 @@ void coreaudio_macos_microphone_free(void *data)
285285
propsize = 0;
286286
status = AudioObjectGetPropertyDataSize(current_device_id, &prop_addr_streams_input, 0, NULL, &propsize);
287287
if (status == noErr && propsize > 0)
288-
{
289288
input_stream_count = propsize / sizeof(AudioStreamID); /* Can be more than 1, but we just need > 0 */
290-
}
291289

292290
if (input_stream_count > 0)
293291
{
292+
CFStringRef device_uid_cf = NULL;
294293
/* This device has input streams, get its name and UID */
295294
CFStringRef device_name_cf = NULL;
296295
propsize = sizeof(CFStringRef);
@@ -299,9 +298,7 @@ void coreaudio_macos_microphone_free(void *data)
299298
kAudioObjectPropertyScopeGlobal,
300299
kAudioObjectPropertyElementMaster
301300
};
302-
status = AudioObjectGetPropertyData(current_device_id, &prop_addr_name, 0, NULL, &propsize, &device_name_cf);
303-
304-
CFStringRef device_uid_cf = NULL;
301+
status = AudioObjectGetPropertyData(current_device_id, &prop_addr_name, 0, NULL, &propsize, &device_name_cf);
305302
propsize = sizeof(CFStringRef);
306303
AudioObjectPropertyAddress prop_addr_uid = {
307304
kAudioDevicePropertyDeviceUID,
@@ -313,7 +310,7 @@ void coreaudio_macos_microphone_free(void *data)
313310
if (status == noErr && device_name_cf && uid_status == noErr && device_uid_cf)
314311
{
315312
char device_name_c[256] = {0};
316-
char device_uid_c[256] = {0};
313+
char device_uid_c[256] = {0};
317314

318315
CFStringGetCString(device_name_cf, device_name_c, sizeof(device_name_c), kCFStringEncodingUTF8);
319316
CFStringGetCString(device_uid_cf, device_uid_c, sizeof(device_uid_c), kCFStringEncodingUTF8);
@@ -335,8 +332,10 @@ void coreaudio_macos_microphone_free(void *data)
335332
}
336333

337334
}
338-
if (device_name_cf) CFRelease(device_name_cf);
339-
if (device_uid_cf) CFRelease(device_uid_cf);
335+
if (device_name_cf)
336+
CFRelease(device_name_cf);
337+
if (device_uid_cf)
338+
CFRelease(device_uid_cf);
340339
}
341340
}
342341

@@ -943,7 +942,6 @@ static AudioDeviceID get_macos_device_id_for_uid_or_name(const char *uid_or_name
943942
for (UInt32 i = 0; i < num_devices; i++)
944943
{
945944
AudioDeviceID current_device_id = all_devices[i];
946-
UInt32 input_stream_count = 0;
947945
AudioObjectPropertyAddress prop_addr_streams_input = {
948946
kAudioDevicePropertyStreams,
949947
kAudioDevicePropertyScopeInput,
@@ -984,7 +982,6 @@ static AudioDeviceID get_macos_device_id_for_uid_or_name(const char *uid_or_name
984982
for (UInt32 i = 0; i < num_devices; i++)
985983
{
986984
AudioDeviceID current_device_id = all_devices[i];
987-
UInt32 input_stream_count = 0;
988985
AudioObjectPropertyAddress prop_addr_streams_input = {
989986
kAudioDevicePropertyStreams,
990987
kAudioDevicePropertyScopeInput,

gfx/common/vulkan_common.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1940,8 +1940,8 @@ bool vulkan_create_swapchain(gfx_ctx_vulkan_data_t *vk,
19401940
settings_t *settings = config_get_ptr();
19411941
bool vsync = settings->bools.video_vsync;
19421942
bool adaptive_vsync = settings->bools.video_adaptive_vsync;
1943-
bool video_windowed_fullscreen = settings->bools.video_windowed_fullscreen;
19441943
#ifdef VK_USE_PLATFORM_WIN32_KHR
1944+
bool video_windowed_fullscreen = settings->bools.video_windowed_fullscreen;
19451945
HMONITOR fse_monitor;
19461946
VkSurfaceFullScreenExclusiveWin32InfoEXT fs_win32 = {
19471947
VK_STRUCTURE_TYPE_SURFACE_FULL_SCREEN_EXCLUSIVE_WIN32_INFO_EXT,
@@ -2371,7 +2371,7 @@ bool vulkan_create_swapchain(gfx_ctx_vulkan_data_t *vk,
23712371

23722372
if (vk->flags & VK_DATA_FLAG_EMULATING_MAILBOX)
23732373
vulkan_emulated_mailbox_init(&vk->mailbox, vk->context.device, vk->swapchain);
2374-
2374+
23752375
/* This flag needs to be cleared otherwise elsewhere it can be perceived as if there's a new swapchain created everytime its being called */
23762376
vk->flags &= ~VK_DATA_FLAG_CREATED_NEW_SWAPCHAIN;
23772377
return true;

gfx/drivers/gl3.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2818,7 +2818,6 @@ static void *gl3_init(const video_info_t *video,
28182818
gl3_t *gl = (gl3_t*)calloc(1, sizeof(gl3_t));
28192819
const gfx_ctx_driver_t *ctx_driver = gl3_get_context(gl);
28202820
struct retro_hw_render_callback *hwr = video_driver_get_hw_context();
2821-
unsigned i;
28222821

28232822
if (!gl || !ctx_driver)
28242823
goto error;
@@ -3923,7 +3922,6 @@ static bool gl3_frame(void *data, const void *frame,
39233922

39243923
if (gl->chain.active)
39253924
{
3926-
unsigned i;
39273925
video_shader_ctx_params_t params;
39283926
struct video_tex_info feedback_info;
39293927

network/cloud_sync/webdav.c

Lines changed: 17 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -128,11 +128,11 @@ static char *webdav_create_ha1_hash(char *user, char *realm, char *pass)
128128
char *hash = (char*)malloc(33);
129129

130130
MD5_Init(&md5);
131-
MD5_Update(&md5, user, strlen(user));
131+
MD5_Update(&md5, user, (unsigned long)strlen(user));
132132
MD5_Update(&md5, ":", 1);
133-
MD5_Update(&md5, realm, strlen(realm));
133+
MD5_Update(&md5, realm, (unsigned long)strlen(realm));
134134
MD5_Update(&md5, ":", 1);
135-
MD5_Update(&md5, pass, strlen(pass));
135+
MD5_Update(&md5, pass, (unsigned long)strlen(pass));
136136
MD5_Final(digest, &md5);
137137

138138
snprintf(hash, 33, "%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x",
@@ -284,9 +284,9 @@ static char *webdav_create_ha1(void)
284284
MD5_Init(&md5);
285285
MD5_Update(&md5, webdav_st->ha1hash, 32);
286286
MD5_Update(&md5, ":", 1);
287-
MD5_Update(&md5, webdav_st->nonce, strlen(webdav_st->nonce));
287+
MD5_Update(&md5, webdav_st->nonce, (unsigned long)strlen(webdav_st->nonce));
288288
MD5_Update(&md5, ":", 1);
289-
MD5_Update(&md5, webdav_st->cnonce, strlen(webdav_st->cnonce));
289+
MD5_Update(&md5, webdav_st->cnonce, (unsigned long)strlen(webdav_st->cnonce));
290290
MD5_Final(digest, &md5);
291291

292292
snprintf(hash, 33, "%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x",
@@ -305,9 +305,9 @@ static char *webdav_create_ha2(const char *method, const char *path)
305305
char *hash = (char*)malloc(33);
306306

307307
MD5_Init(&md5);
308-
MD5_Update(&md5, method, strlen(method));
308+
MD5_Update(&md5, method, (unsigned long)strlen(method));
309309
MD5_Update(&md5, ":", 1);
310-
MD5_Update(&md5, path, strlen(path));
310+
MD5_Update(&md5, path, (unsigned long)strlen(path));
311311
MD5_Final(digest, &md5);
312312

313313
snprintf(hash, 33, "%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x",
@@ -330,15 +330,15 @@ static char *webdav_create_digest_response(const char *method, const char *path)
330330
MD5_Init(&md5);
331331
MD5_Update(&md5, ha1, 32);
332332
MD5_Update(&md5, ":", 1);
333-
MD5_Update(&md5, webdav_st->nonce, strlen(webdav_st->nonce));
333+
MD5_Update(&md5, webdav_st->nonce, (unsigned long)strlen(webdav_st->nonce));
334334
if (webdav_st->qop_auth)
335335
{
336336
char nonceCount[10];
337337
snprintf(nonceCount, sizeof(nonceCount), "%08x", webdav_st->nc);
338338
MD5_Update(&md5, ":", 1);
339-
MD5_Update(&md5, nonceCount, strlen(nonceCount));
339+
MD5_Update(&md5, nonceCount, (unsigned long)strlen(nonceCount));
340340
MD5_Update(&md5, ":", 1);
341-
MD5_Update(&md5, webdav_st->cnonce, strlen(webdav_st->cnonce));
341+
MD5_Update(&md5, webdav_st->cnonce, (unsigned long)strlen(webdav_st->cnonce));
342342
MD5_Update(&md5, ":", 1);
343343
MD5_Update(&md5, "auth", STRLEN_CONST("auth"));
344344
}
@@ -469,8 +469,7 @@ static bool webdav_needs_reauth(http_transfer_data_t *data)
469469
RARCH_DBG("[webdav] Found WWW-Authenticate: Digest header\n");
470470
if (webdav_create_digest_auth(data->headers->elems[i].data))
471471
return true;
472-
else
473-
RARCH_WARN("[webdav] Failure creating WWW-Authenticate: Digest header\n");
472+
RARCH_WARN("[webdav] Failure creating WWW-Authenticate: Digest header\n");
474473
}
475474

476475
return false;
@@ -624,7 +623,7 @@ static bool webdav_read(const char *path, const char *file,
624623
fill_pathname_join_special(url, webdav_st->url, path, sizeof(url));
625624
net_http_urlencode_full(url_encoded, url, sizeof(url_encoded));
626625

627-
webdav_cb_st->cb = cb;
626+
webdav_cb_st->cb = cb;
628627
webdav_cb_st->user_data = user_data;
629628
strlcpy(webdav_cb_st->path, path, sizeof(webdav_cb_st->path));
630629
strlcpy(webdav_cb_st->file, file, sizeof(webdav_cb_st->file));
@@ -672,7 +671,7 @@ static void webdav_mkdir_cb(retro_task_t *task, void *task_data,
672671
webdav_mkdir_st->last_slash = strchr(webdav_mkdir_st->last_slash + 1, '/');
673672
if (webdav_mkdir_st->last_slash)
674673
{
675-
webdav_mkdir_st->post_slash = webdav_mkdir_st->last_slash[1];
674+
webdav_mkdir_st->post_slash = webdav_mkdir_st->last_slash[1];
676675
webdav_mkdir_st->last_slash[1] = '\0';
677676
RARCH_DBG("[webdav] MKCOL %s\n", webdav_mkdir_st->url);
678677
auth_header = webdav_get_auth_header("MKCOL", webdav_mkdir_st->url);
@@ -690,17 +689,17 @@ static void webdav_mkdir_cb(retro_task_t *task, void *task_data,
690689
static void webdav_ensure_dir(const char *dir, webdav_mkdir_cb_t cb,
691690
webdav_cb_state_t *webdav_cb_st)
692691
{
692+
char url[PATH_MAX_LENGTH];
693693
http_transfer_data_t data;
694694
webdav_state_t *webdav_st = webdav_state_get_ptr();
695695
webdav_mkdir_state_t *webdav_mkdir_st = (webdav_mkdir_state_t *)malloc(sizeof(webdav_mkdir_state_t));
696-
char url[PATH_MAX_LENGTH];
697696

698697
fill_pathname_join_special(url, webdav_st->url, dir, sizeof(url));
699698
net_http_urlencode_full(webdav_mkdir_st->url, url, sizeof(webdav_mkdir_st->url));
700699
webdav_mkdir_st->last_slash = strchr(webdav_mkdir_st->url + strlen(webdav_st->url) - 1, '/');
701700
webdav_mkdir_st->post_slash = webdav_mkdir_st->last_slash[1];
702-
webdav_mkdir_st->cb = cb;
703-
webdav_mkdir_st->cb_st = webdav_cb_st;
701+
webdav_mkdir_st->cb = cb;
702+
webdav_mkdir_st->cb_st = webdav_cb_st;
704703

705704
/* this is a recursive callback, set it up so it looks like it's still proceeding */
706705
data.status = 200;
@@ -775,8 +774,8 @@ static void webdav_do_update(bool success, webdav_cb_state_t *webdav_cb_st)
775774
static bool webdav_update(const char *path, RFILE *rfile,
776775
cloud_sync_complete_handler_t cb, void *user_data)
777776
{
778-
webdav_cb_state_t *webdav_cb_st = (webdav_cb_state_t*)calloc(1, sizeof(webdav_cb_state_t));
779777
char dir[DIR_MAX_LENGTH];
778+
webdav_cb_state_t *webdav_cb_st = (webdav_cb_state_t*)calloc(1, sizeof(webdav_cb_state_t));
780779

781780
/* TODO/FIXME: if !settings->bools.cloud_sync_destructive, should move to deleted/ first */
782781

0 commit comments

Comments
 (0)