From 5351e2918ee268a6ad6b6764af6305fddcc30f45 Mon Sep 17 00:00:00 2001 From: Bret Ambrose Date: Thu, 7 Nov 2024 11:03:30 -0800 Subject: [PATCH 1/3] Use proper public event loop group API --- source/s3_client.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/source/s3_client.c b/source/s3_client.c index c1f2fcf7..33a4c8d6 100644 --- a/source/s3_client.c +++ b/source/s3_client.c @@ -528,8 +528,7 @@ struct aws_s3_client *aws_s3_client_new( /* Set up body streaming ELG */ { - uint16_t num_event_loops = - (uint16_t)aws_array_list_length(&client->client_bootstrap->event_loop_group->event_loops); + uint16_t num_event_loops = aws_event_loop_group_get_loop_count(client->client_bootstrap->event_loop_group); uint16_t num_streaming_threads = num_event_loops; if (num_streaming_threads < 1) { From 5a3032c9dbcdbcd27b122e681121006e08318814 Mon Sep 17 00:00:00 2001 From: Bret Ambrose Date: Mon, 11 Nov 2024 07:51:35 -0800 Subject: [PATCH 2/3] Narrowing cast removal --- source/s3_client.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/s3_client.c b/source/s3_client.c index 33a4c8d6..9fcfdfa5 100644 --- a/source/s3_client.c +++ b/source/s3_client.c @@ -528,8 +528,8 @@ struct aws_s3_client *aws_s3_client_new( /* Set up body streaming ELG */ { - uint16_t num_event_loops = aws_event_loop_group_get_loop_count(client->client_bootstrap->event_loop_group); - uint16_t num_streaming_threads = num_event_loops; + size_t num_event_loops = aws_event_loop_group_get_loop_count(client->client_bootstrap->event_loop_group); + size_t num_streaming_threads = num_event_loops; if (num_streaming_threads < 1) { num_streaming_threads = 1; From cfd2b1e640eafb95529be7651bbd7a0981cfc5db Mon Sep 17 00:00:00 2001 From: Bret Ambrose Date: Mon, 11 Nov 2024 07:57:41 -0800 Subject: [PATCH 3/3] Narrowing cast v2 --- source/s3_client.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/source/s3_client.c b/source/s3_client.c index 9fcfdfa5..87d9cb3f 100644 --- a/source/s3_client.c +++ b/source/s3_client.c @@ -528,8 +528,9 @@ struct aws_s3_client *aws_s3_client_new( /* Set up body streaming ELG */ { - size_t num_event_loops = aws_event_loop_group_get_loop_count(client->client_bootstrap->event_loop_group); - size_t num_streaming_threads = num_event_loops; + uint16_t num_event_loops = + (uint16_t)aws_event_loop_group_get_loop_count(client->client_bootstrap->event_loop_group); + uint16_t num_streaming_threads = num_event_loops; if (num_streaming_threads < 1) { num_streaming_threads = 1;