From 9d2c823cdbe5693d8a89ba8f6b09ad81d98332c6 Mon Sep 17 00:00:00 2001 From: Dane Walton Date: Fri, 13 Nov 2020 13:44:28 -0800 Subject: [PATCH 1/3] update source file to not have right hand const --- sdk/src/azure/core/az_context.c | 12 +++++------ sdk/src/azure/core/az_http_policy_logging.c | 10 +++++----- sdk/src/azure/core/az_http_request.c | 10 +++++----- sdk/src/azure/core/az_http_response.c | 2 +- sdk/src/azure/core/az_json_reader.c | 4 ++-- sdk/src/azure/core/az_json_token.c | 20 +++++++++---------- sdk/src/azure/core/az_json_writer.c | 10 +++++----- sdk/src/azure/core/az_span.c | 2 +- sdk/src/azure/iot/az_iot_hub_client.c | 6 +++--- sdk/src/azure/iot/az_iot_hub_client_c2d.c | 2 +- sdk/src/azure/iot/az_iot_hub_client_methods.c | 4 ++-- sdk/src/azure/iot/az_iot_hub_client_sas.c | 4 ++-- .../azure/iot/az_iot_hub_client_telemetry.c | 4 ++-- sdk/src/azure/iot/az_iot_hub_client_twin.c | 6 +++--- .../azure/iot/az_iot_provisioning_client.c | 12 +++++------ .../iot/az_iot_provisioning_client_sas.c | 4 ++-- sdk/src/azure/platform/az_curl.c | 16 +++++++-------- sdk/src/azure/platform/az_nohttp.c | 2 +- 18 files changed, 65 insertions(+), 65 deletions(-) diff --git a/sdk/src/azure/core/az_context.c b/sdk/src/azure/core/az_context.c index d5a89710ae..fd9c12b734 100644 --- a/sdk/src/azure/core/az_context.c +++ b/sdk/src/azure/core/az_context.c @@ -36,7 +36,7 @@ AZ_NODISCARD int64_t az_context_get_expiration(az_context const* context) // and return the corresponding value. Returns AZ_ERROR_ITEM_NOT_FOUND is there are no nodes // matching the specified key. AZ_NODISCARD az_result -az_context_get_value(az_context const* context, void const* const key, void const** out_value) +az_context_get_value(az_context const* context, void const* key, void const** out_value) { _az_PRECONDITION_NOT_NULL(context); _az_PRECONDITION_NOT_NULL(out_value); @@ -55,7 +55,7 @@ az_context_get_value(az_context const* context, void const* const key, void cons } AZ_NODISCARD az_context -az_context_create_with_expiration(az_context const* const parent, int64_t expiration) +az_context_create_with_expiration(az_context const* parent, int64_t expiration) { _az_PRECONDITION_NOT_NULL(parent); _az_PRECONDITION(expiration >= 0); @@ -64,9 +64,9 @@ az_context_create_with_expiration(az_context const* const parent, int64_t expira } AZ_NODISCARD az_context az_context_create_with_value( - az_context const* const parent, - void const* const key, - void const* const value) + az_context const* parent, + void const* key, + void const* value) { _az_PRECONDITION_NOT_NULL(parent); _az_PRECONDITION_NOT_NULL(key); @@ -84,7 +84,7 @@ void az_context_cancel(az_context* ref_context) ref_context->_internal.expiration = 0; // The beginning of time } -AZ_NODISCARD bool az_context_has_expired(az_context const* const context, int64_t current_time) +AZ_NODISCARD bool az_context_has_expired(az_context const* context, int64_t current_time) { _az_PRECONDITION_NOT_NULL(context); _az_PRECONDITION(current_time >= 0); diff --git a/sdk/src/azure/core/az_http_policy_logging.c b/sdk/src/azure/core/az_http_policy_logging.c index eca4991c9f..1bf5e79cec 100644 --- a/sdk/src/azure/core/az_http_policy_logging.c +++ b/sdk/src/azure/core/az_http_policy_logging.c @@ -55,7 +55,7 @@ static az_span _az_http_policy_logging_copy_lengthy_value(az_span ref_log_msg, a } static az_result _az_http_policy_logging_append_http_request_msg( - az_http_request const* const request, + az_http_request const* request, az_span* ref_log_msg) { static az_span const auth_header_name = AZ_SPAN_LITERAL_FROM_STR("authorization"); @@ -124,7 +124,7 @@ static az_result _az_http_policy_logging_append_http_request_msg( static az_result _az_http_policy_logging_append_http_response_msg( az_http_response* ref_response, int64_t duration_msec, - az_http_request const* const request, + az_http_request const* request, az_span* ref_log_msg) { az_span http_response_string = AZ_SPAN_FROM_STR("HTTP Response ("); @@ -207,7 +207,7 @@ static az_result _az_http_policy_logging_append_http_response_msg( return AZ_OK; } -void _az_http_policy_logging_log_http_request(az_http_request const* const request) +void _az_http_policy_logging_log_http_request(az_http_request const* request) { uint8_t log_msg_buf[AZ_LOG_MESSAGE_BUFFER_SIZE] = { 0 }; az_span log_msg = AZ_SPAN_FROM_BUFFER(log_msg_buf); @@ -218,9 +218,9 @@ void _az_http_policy_logging_log_http_request(az_http_request const* const reque } void _az_http_policy_logging_log_http_response( - az_http_response const* const response, + az_http_response const* response, int64_t duration_msec, - az_http_request const* const request) + az_http_request const* request) { uint8_t log_msg_buf[AZ_LOG_MESSAGE_BUFFER_SIZE] = { 0 }; az_span log_msg = AZ_SPAN_FROM_BUFFER(log_msg_buf); diff --git a/sdk/src/azure/core/az_http_request.c b/sdk/src/azure/core/az_http_request.c index 8b64d01861..51ec138d26 100644 --- a/sdk/src/azure/core/az_http_request.c +++ b/sdk/src/azure/core/az_http_request.c @@ -149,7 +149,7 @@ az_http_request_append_header(az_http_request* ref_request, az_span name, az_spa } AZ_NODISCARD az_result az_http_request_get_header( - az_http_request const* const request, + az_http_request const* request, int32_t index, az_span* out_name, az_span* out_value) @@ -173,7 +173,7 @@ AZ_NODISCARD az_result az_http_request_get_header( } AZ_NODISCARD az_result -az_http_request_get_method(az_http_request const* const request, az_http_method* out_method) +az_http_request_get_method(az_http_request const* request, az_http_method* out_method) { _az_PRECONDITION_NOT_NULL(request); _az_PRECONDITION_NOT_NULL(out_method); @@ -184,7 +184,7 @@ az_http_request_get_method(az_http_request const* const request, az_http_method* } AZ_NODISCARD az_result -az_http_request_get_url(az_http_request const* const request, az_span* out_url) +az_http_request_get_url(az_http_request const* request, az_span* out_url) { _az_PRECONDITION_NOT_NULL(request); _az_PRECONDITION_NOT_NULL(out_url); @@ -195,7 +195,7 @@ az_http_request_get_url(az_http_request const* const request, az_span* out_url) } AZ_NODISCARD az_result -az_http_request_get_body(az_http_request const* const request, az_span* out_body) +az_http_request_get_body(az_http_request const* request, az_span* out_body) { _az_PRECONDITION_NOT_NULL(request); _az_PRECONDITION_NOT_NULL(out_body); @@ -204,7 +204,7 @@ az_http_request_get_body(az_http_request const* const request, az_span* out_body return AZ_OK; } -AZ_NODISCARD int32_t az_http_request_headers_count(az_http_request const* const request) +AZ_NODISCARD int32_t az_http_request_headers_count(az_http_request const* request) { return request->_internal.headers_length; } diff --git a/sdk/src/azure/core/az_http_response.c b/sdk/src/azure/core/az_http_response.c index 2c69bb4581..4f28200966 100644 --- a/sdk/src/azure/core/az_http_response.c +++ b/sdk/src/azure/core/az_http_response.c @@ -327,7 +327,7 @@ void _az_http_response_reset(az_http_response* ref_response) } // internal function to get az_http_response remainder -static az_span _az_http_response_get_remaining(az_http_response const* const response) +static az_span _az_http_response_get_remaining(az_http_response const* response) { return az_span_slice_to_end(response->_internal.http_response, response->_internal.written); } diff --git a/sdk/src/azure/core/az_json_reader.c b/sdk/src/azure/core/az_json_reader.c index 817b6e08a5..084abb4884 100644 --- a/sdk/src/azure/core/az_json_reader.c +++ b/sdk/src/azure/core/az_json_reader.c @@ -14,7 +14,7 @@ AZ_NODISCARD az_result az_json_reader_init( az_json_reader* out_json_reader, az_span json_buffer, - az_json_reader_options const* const options) + az_json_reader_options const* options) { _az_PRECONDITION(az_span_size(json_buffer) >= 1); @@ -52,7 +52,7 @@ AZ_NODISCARD az_result az_json_reader_chunked_init( az_json_reader* out_json_reader, az_span json_buffers[], int32_t number_of_buffers, - az_json_reader_options const* const options) + az_json_reader_options const* options) { _az_PRECONDITION(number_of_buffers >= 1); _az_PRECONDITION(az_span_size(json_buffers[0]) >= 1); diff --git a/sdk/src/azure/core/az_json_token.c b/sdk/src/azure/core/az_json_token.c index 087da8aaed..a87a5da9b1 100644 --- a/sdk/src/azure/core/az_json_token.c +++ b/sdk/src/azure/core/az_json_token.c @@ -11,7 +11,7 @@ #include static az_span _az_json_token_copy_into_span_helper( - az_json_token const* const json_token, + az_json_token const* json_token, az_span destination) { _az_PRECONDITION(json_token->_internal.is_multisegment); @@ -40,7 +40,7 @@ static az_span _az_json_token_copy_into_span_helper( return destination; } -az_span az_json_token_copy_into_span(az_json_token const* const json_token, az_span destination) +az_span az_json_token_copy_into_span(az_json_token const* json_token, az_span destination) { _az_PRECONDITION_VALID_SPAN(destination, json_token->size, false); @@ -149,7 +149,7 @@ AZ_NODISCARD static bool _az_json_token_is_text_equal_helper( } AZ_NODISCARD bool az_json_token_is_text_equal( - az_json_token const* const json_token, + az_json_token const* json_token, az_span expected_text) { _az_PRECONDITION_NOT_NULL(json_token); @@ -244,7 +244,7 @@ AZ_NODISCARD bool az_json_token_is_text_equal( } AZ_NODISCARD az_result -az_json_token_get_boolean(az_json_token const* const json_token, bool* out_value) +az_json_token_get_boolean(az_json_token const* json_token, bool* out_value) { _az_PRECONDITION_NOT_NULL(json_token); _az_PRECONDITION_NOT_NULL(out_value); @@ -327,7 +327,7 @@ AZ_NODISCARD static az_result _az_json_token_get_string_helper( } AZ_NODISCARD az_result az_json_token_get_string( - az_json_token const* const json_token, + az_json_token const* json_token, char* destination, int32_t destination_max_size, int32_t* out_string_length) @@ -430,7 +430,7 @@ AZ_NODISCARD az_result az_json_token_get_string( } AZ_NODISCARD az_result -az_json_token_get_uint64(az_json_token const* const json_token, uint64_t* out_value) +az_json_token_get_uint64(az_json_token const* json_token, uint64_t* out_value) { _az_PRECONDITION_NOT_NULL(json_token); _az_PRECONDITION_NOT_NULL(out_value); @@ -465,7 +465,7 @@ az_json_token_get_uint64(az_json_token const* const json_token, uint64_t* out_va } AZ_NODISCARD az_result -az_json_token_get_uint32(az_json_token const* const json_token, uint32_t* out_value) +az_json_token_get_uint32(az_json_token const* json_token, uint32_t* out_value) { _az_PRECONDITION_NOT_NULL(json_token); _az_PRECONDITION_NOT_NULL(out_value); @@ -500,7 +500,7 @@ az_json_token_get_uint32(az_json_token const* const json_token, uint32_t* out_va } AZ_NODISCARD az_result -az_json_token_get_int64(az_json_token const* const json_token, int64_t* out_value) +az_json_token_get_int64(az_json_token const* json_token, int64_t* out_value) { _az_PRECONDITION_NOT_NULL(json_token); _az_PRECONDITION_NOT_NULL(out_value); @@ -535,7 +535,7 @@ az_json_token_get_int64(az_json_token const* const json_token, int64_t* out_valu } AZ_NODISCARD az_result -az_json_token_get_int32(az_json_token const* const json_token, int32_t* out_value) +az_json_token_get_int32(az_json_token const* json_token, int32_t* out_value) { _az_PRECONDITION_NOT_NULL(json_token); _az_PRECONDITION_NOT_NULL(out_value); @@ -570,7 +570,7 @@ az_json_token_get_int32(az_json_token const* const json_token, int32_t* out_valu } AZ_NODISCARD az_result -az_json_token_get_double(az_json_token const* const json_token, double* out_value) +az_json_token_get_double(az_json_token const* json_token, double* out_value) { _az_PRECONDITION_NOT_NULL(json_token); _az_PRECONDITION_NOT_NULL(out_value); diff --git a/sdk/src/azure/core/az_json_writer.c b/sdk/src/azure/core/az_json_writer.c index b59d7b3307..d962dc265d 100644 --- a/sdk/src/azure/core/az_json_writer.c +++ b/sdk/src/azure/core/az_json_writer.c @@ -15,7 +15,7 @@ AZ_NODISCARD az_result az_json_writer_init( az_json_writer* out_json_writer, az_span destination_buffer, - az_json_writer_options const* const options) + az_json_writer_options const* options) { _az_PRECONDITION_NOT_NULL(out_json_writer); @@ -40,7 +40,7 @@ AZ_NODISCARD az_result az_json_writer_chunked_init( az_span first_destination_buffer, az_span_allocator_fn allocator_callback, void* user_context, - az_json_writer_options const* const options) + az_json_writer_options const* options) { _az_PRECONDITION_NOT_NULL(out_json_writer); _az_PRECONDITION_NOT_NULL(allocator_callback); @@ -93,7 +93,7 @@ _get_remaining_span(az_json_writer* ref_json_writer, int32_t required_size) // This validation method is used outside of just preconditions, within // az_json_writer_append_json_text. -static AZ_NODISCARD bool _az_is_appending_value_valid(az_json_writer const* const json_writer) +static AZ_NODISCARD bool _az_is_appending_value_valid(az_json_writer const* json_writer) { _az_PRECONDITION_NOT_NULL(json_writer); @@ -137,7 +137,7 @@ static AZ_NODISCARD bool _az_is_appending_value_valid(az_json_writer const* cons #ifndef AZ_NO_PRECONDITION_CHECKING static AZ_NODISCARD bool _az_is_appending_property_name_valid( - az_json_writer const* const json_writer) + az_json_writer const* json_writer) { _az_PRECONDITION_NOT_NULL(json_writer); @@ -157,7 +157,7 @@ static AZ_NODISCARD bool _az_is_appending_property_name_valid( } static AZ_NODISCARD bool _az_is_appending_container_end_valid( - az_json_writer const* const json_writer, + az_json_writer const* json_writer, uint8_t byte) { _az_PRECONDITION_NOT_NULL(json_writer); diff --git a/sdk/src/azure/core/az_span.c b/sdk/src/azure/core/az_span.c index aa9cb72169..746e793448 100644 --- a/sdk/src/azure/core/az_span.c +++ b/sdk/src/azure/core/az_span.c @@ -915,7 +915,7 @@ AZ_NODISCARD int32_t _az_span_url_encode_calc_length(az_span source) _az_PRECONDITION_RANGE(0, az_span_size(source), INT32_MAX / 3); int32_t const source_size = az_span_size(source); - uint8_t const* const src_ptr = az_span_ptr(source); + uint8_t const* src_ptr = az_span_ptr(source); int32_t encoded_length = source_size; for (int32_t i = 0; i < source_size; i++) diff --git a/sdk/src/azure/iot/az_iot_hub_client.c b/sdk/src/azure/iot/az_iot_hub_client.c index 810020f363..b5b87f7f37 100644 --- a/sdk/src/azure/iot/az_iot_hub_client.c +++ b/sdk/src/azure/iot/az_iot_hub_client.c @@ -35,7 +35,7 @@ AZ_NODISCARD az_result az_iot_hub_client_init( az_iot_hub_client* client, az_span iot_hub_hostname, az_span device_id, - az_iot_hub_client_options const* const options) + az_iot_hub_client_options const* options) { _az_PRECONDITION_NOT_NULL(client); _az_PRECONDITION_VALID_SPAN(iot_hub_hostname, 1, false); @@ -49,7 +49,7 @@ AZ_NODISCARD az_result az_iot_hub_client_init( } AZ_NODISCARD az_result az_iot_hub_client_get_user_name( - az_iot_hub_client const* const client, + az_iot_hub_client const* client, char* mqtt_user_name, size_t mqtt_user_name_size, size_t* out_mqtt_user_name_length) @@ -132,7 +132,7 @@ AZ_NODISCARD az_result az_iot_hub_client_get_user_name( } AZ_NODISCARD az_result az_iot_hub_client_get_client_id( - az_iot_hub_client const* const client, + az_iot_hub_client const* client, char* mqtt_client_id, size_t mqtt_client_id_size, size_t* out_mqtt_client_id_length) diff --git a/sdk/src/azure/iot/az_iot_hub_client_c2d.c b/sdk/src/azure/iot/az_iot_hub_client_c2d.c index 76905c4279..ea97917210 100644 --- a/sdk/src/azure/iot/az_iot_hub_client_c2d.c +++ b/sdk/src/azure/iot/az_iot_hub_client_c2d.c @@ -17,7 +17,7 @@ static const az_span c2d_topic_suffix = AZ_SPAN_LITERAL_FROM_STR("/messages/devicebound/"); AZ_NODISCARD az_result az_iot_hub_client_c2d_parse_received_topic( - az_iot_hub_client const* const client, + az_iot_hub_client const* client, az_span received_topic, az_iot_hub_client_c2d_request* out_request) { diff --git a/sdk/src/azure/iot/az_iot_hub_client_methods.c b/sdk/src/azure/iot/az_iot_hub_client_methods.c index 36071a2f0f..6afe42590e 100644 --- a/sdk/src/azure/iot/az_iot_hub_client_methods.c +++ b/sdk/src/azure/iot/az_iot_hub_client_methods.c @@ -22,7 +22,7 @@ static const az_span methods_response_topic_result = AZ_SPAN_LITERAL_FROM_STR("r static const az_span methods_response_topic_properties = AZ_SPAN_LITERAL_FROM_STR("/?$rid="); AZ_NODISCARD az_result az_iot_hub_client_methods_parse_received_topic( - az_iot_hub_client const* const client, + az_iot_hub_client const* client, az_span received_topic, az_iot_hub_client_method_request* out_request) { @@ -77,7 +77,7 @@ AZ_NODISCARD az_result az_iot_hub_client_methods_parse_received_topic( } AZ_NODISCARD az_result az_iot_hub_client_methods_response_get_publish_topic( - az_iot_hub_client const* const client, + az_iot_hub_client const* client, az_span request_id, uint16_t status, char* mqtt_topic, diff --git a/sdk/src/azure/iot/az_iot_hub_client_sas.c b/sdk/src/azure/iot/az_iot_hub_client_sas.c index 80fcfdce4a..2dc341a59a 100644 --- a/sdk/src/azure/iot/az_iot_hub_client_sas.c +++ b/sdk/src/azure/iot/az_iot_hub_client_sas.c @@ -34,7 +34,7 @@ static const az_span sig_string = AZ_SPAN_LITERAL_FROM_STR(SAS_TOKEN_SIG); static const az_span se_string = AZ_SPAN_LITERAL_FROM_STR(SAS_TOKEN_SE); AZ_NODISCARD az_result az_iot_hub_client_sas_get_signature( - az_iot_hub_client const* const client, + az_iot_hub_client const* client, uint64_t token_expiration_epoch_time, az_span signature, az_span* out_signature) @@ -81,7 +81,7 @@ AZ_NODISCARD az_result az_iot_hub_client_sas_get_signature( } AZ_NODISCARD az_result az_iot_hub_client_sas_get_password( - az_iot_hub_client const* const client, + az_iot_hub_client const* client, uint64_t token_expiration_epoch_time, az_span base64_hmac_sha256_signature, az_span key_name, diff --git a/sdk/src/azure/iot/az_iot_hub_client_telemetry.c b/sdk/src/azure/iot/az_iot_hub_client_telemetry.c index e8770efa31..c628cd86cf 100644 --- a/sdk/src/azure/iot/az_iot_hub_client_telemetry.c +++ b/sdk/src/azure/iot/az_iot_hub_client_telemetry.c @@ -18,8 +18,8 @@ static const az_span telemetry_topic_modules_mid = AZ_SPAN_LITERAL_FROM_STR("/mo static const az_span telemetry_topic_suffix = AZ_SPAN_LITERAL_FROM_STR("/messages/events/"); AZ_NODISCARD az_result az_iot_hub_client_telemetry_get_publish_topic( - az_iot_hub_client const* const client, - az_iot_message_properties const* const properties, + az_iot_hub_client const* client, + az_iot_message_properties const* properties, char* mqtt_topic, size_t mqtt_topic_size, size_t* out_mqtt_topic_length) diff --git a/sdk/src/azure/iot/az_iot_hub_client_twin.c b/sdk/src/azure/iot/az_iot_hub_client_twin.c index 322dbf4081..1e0f3423a6 100644 --- a/sdk/src/azure/iot/az_iot_hub_client_twin.c +++ b/sdk/src/azure/iot/az_iot_hub_client_twin.c @@ -28,7 +28,7 @@ static const az_span az_iot_hub_twin_patch_sub_topic = AZ_SPAN_LITERAL_FROM_STR("PATCH/properties/desired/"); AZ_NODISCARD az_result az_iot_hub_client_twin_document_get_publish_topic( - az_iot_hub_client const* const client, + az_iot_hub_client const* client, az_span request_id, char* mqtt_topic, size_t mqtt_topic_size, @@ -68,7 +68,7 @@ AZ_NODISCARD az_result az_iot_hub_client_twin_document_get_publish_topic( } AZ_NODISCARD az_result az_iot_hub_client_twin_patch_get_publish_topic( - az_iot_hub_client const* const client, + az_iot_hub_client const* client, az_span request_id, char* mqtt_topic, size_t mqtt_topic_size, @@ -108,7 +108,7 @@ AZ_NODISCARD az_result az_iot_hub_client_twin_patch_get_publish_topic( } AZ_NODISCARD az_result az_iot_hub_client_twin_parse_received_topic( - az_iot_hub_client const* const client, + az_iot_hub_client const* client, az_span received_topic, az_iot_hub_client_twin_response* out_response) { diff --git a/sdk/src/azure/iot/az_iot_provisioning_client.c b/sdk/src/azure/iot/az_iot_provisioning_client.c index 67fc4fa7f4..483c335659 100644 --- a/sdk/src/azure/iot/az_iot_provisioning_client.c +++ b/sdk/src/azure/iot/az_iot_provisioning_client.c @@ -51,7 +51,7 @@ AZ_NODISCARD az_result az_iot_provisioning_client_init( az_span global_device_hostname, az_span id_scope, az_span registration_id, - az_iot_provisioning_client_options const* const options) + az_iot_provisioning_client_options const* options) { _az_PRECONDITION_NOT_NULL(client); _az_PRECONDITION_VALID_SPAN(global_device_hostname, 1, false); @@ -70,7 +70,7 @@ AZ_NODISCARD az_result az_iot_provisioning_client_init( // /registrations//api-version= AZ_NODISCARD az_result az_iot_provisioning_client_get_user_name( - az_iot_provisioning_client const* const client, + az_iot_provisioning_client const* client, char* mqtt_user_name, size_t mqtt_user_name_size, size_t* out_mqtt_user_name_length) @@ -123,7 +123,7 @@ AZ_NODISCARD az_result az_iot_provisioning_client_get_user_name( // AZ_NODISCARD az_result az_iot_provisioning_client_get_client_id( - az_iot_provisioning_client const* const client, + az_iot_provisioning_client const* client, char* mqtt_client_id, size_t mqtt_client_id_size, size_t* out_mqtt_client_id_length) @@ -153,7 +153,7 @@ AZ_NODISCARD az_result az_iot_provisioning_client_get_client_id( // $dps/registrations/PUT/iotdps-register/?$rid=%s AZ_NODISCARD az_result az_iot_provisioning_client_register_get_publish_topic( - az_iot_provisioning_client const* const client, + az_iot_provisioning_client const* client, char* mqtt_topic, size_t mqtt_topic_size, size_t* out_mqtt_topic_length) @@ -187,7 +187,7 @@ AZ_NODISCARD az_result az_iot_provisioning_client_register_get_publish_topic( // Topic: $dps/registrations/GET/iotdps-get-operationstatus/?$rid=%s&operationId=%s AZ_NODISCARD az_result az_iot_provisioning_client_query_status_get_publish_topic( - az_iot_provisioning_client const* const client, + az_iot_provisioning_client const* client, az_span operation_id, char* mqtt_topic, size_t mqtt_topic_size, @@ -509,7 +509,7 @@ Stage 3: certificate.","timestampUtc":"2020-04-10T05:24:22.4718526Z"} */ AZ_NODISCARD az_result az_iot_provisioning_client_parse_received_topic_and_payload( - az_iot_provisioning_client const* const client, + az_iot_provisioning_client const* client, az_span received_topic, az_span received_payload, az_iot_provisioning_client_register_response* out_response) diff --git a/sdk/src/azure/iot/az_iot_provisioning_client_sas.c b/sdk/src/azure/iot/az_iot_provisioning_client_sas.c index a95070a903..a076c8a830 100644 --- a/sdk/src/azure/iot/az_iot_provisioning_client_sas.c +++ b/sdk/src/azure/iot/az_iot_provisioning_client_sas.c @@ -31,7 +31,7 @@ static const az_span skn_string = AZ_SPAN_LITERAL_FROM_STR(SAS_TOKEN_SKN); static const az_span se_string = AZ_SPAN_LITERAL_FROM_STR(SAS_TOKEN_SE); AZ_NODISCARD az_result az_iot_provisioning_client_sas_get_signature( - az_iot_provisioning_client const* const client, + az_iot_provisioning_client const* client, uint64_t token_expiration_epoch_time, az_span signature, az_span* out_signature) @@ -69,7 +69,7 @@ AZ_NODISCARD az_result az_iot_provisioning_client_sas_get_signature( } AZ_NODISCARD az_result az_iot_provisioning_client_sas_get_password( - az_iot_provisioning_client const* const client, + az_iot_provisioning_client const* client, az_span base64_hmac_sha256_signature, uint64_t token_expiration_epoch_time, az_span key_name, diff --git a/sdk/src/azure/platform/az_curl.c b/sdk/src/azure/platform/az_curl.c index df36148654..8c017a3d92 100644 --- a/sdk/src/azure/platform/az_curl.c +++ b/sdk/src/azure/platform/az_curl.c @@ -108,7 +108,7 @@ static AZ_NODISCARD az_result _az_span_append_header_to_buffer( } static AZ_NODISCARD az_result -_az_http_client_curl_slist_append(struct curl_slist** ref_list, char const* const str) +_az_http_client_curl_slist_append(struct curl_slist** ref_list, char const* str) { _az_PRECONDITION_NOT_NULL(ref_list); _az_PRECONDITION_NOT_NULL(str); @@ -216,7 +216,7 @@ _az_http_client_curl_add_expect_header(CURL* ref_curl, struct curl_slist** ref_l * @return az_result */ static AZ_NODISCARD az_result _az_http_client_curl_build_headers( - az_http_request const* const request, + az_http_request const* request, struct curl_slist** ref_headers) { _az_PRECONDITION_NOT_NULL(request); @@ -317,7 +317,7 @@ static AZ_NODISCARD az_result _az_http_client_curl_send_delete_request(CURL* ref * handles POST request. It handles seting up a body for request */ static AZ_NODISCARD az_result -_az_http_client_curl_send_post_request(CURL* ref_curl, az_http_request const* const request) +_az_http_client_curl_send_post_request(CURL* ref_curl, az_http_request const* request) { _az_PRECONDITION_NOT_NULL(ref_curl); _az_PRECONDITION_NOT_NULL(request); @@ -407,7 +407,7 @@ static int32_t _az_http_client_curl_upload_read_callback( * As of CURL 7.12.1 CURLOPT_PUT is deprecated. PUT requests should be made using CURLOPT_UPLOAD */ static AZ_NODISCARD az_result -_az_http_client_curl_send_upload_request(CURL* ref_curl, az_http_request const* const request) +_az_http_client_curl_send_upload_request(CURL* ref_curl, az_http_request const* request) { _az_PRECONDITION_NOT_NULL(ref_curl); _az_PRECONDITION_NOT_NULL(request); @@ -445,7 +445,7 @@ _az_http_client_curl_send_upload_request(CURL* ref_curl, az_http_request const* static AZ_NODISCARD az_result _az_http_client_curl_setup_headers( CURL* ref_curl, struct curl_slist** ref_list, - az_http_request const* const request) + az_http_request const* request) { _az_PRECONDITION_NOT_NULL(ref_curl); _az_PRECONDITION_NOT_NULL(request); @@ -472,7 +472,7 @@ static AZ_NODISCARD az_result _az_http_client_curl_setup_headers( * @return az_result */ static AZ_NODISCARD az_result -_az_http_client_curl_setup_url(CURL* ref_curl, az_http_request const* const request) +_az_http_client_curl_setup_url(CURL* ref_curl, az_http_request const* request) { _az_PRECONDITION_NOT_NULL(ref_curl); _az_PRECONDITION_NOT_NULL(request); @@ -548,7 +548,7 @@ _az_http_client_curl_setup_response_redirect(CURL* ref_curl, az_http_response* r */ static AZ_NODISCARD az_result _az_http_client_curl_send_request_impl_process( CURL* ref_curl, - az_http_request const* const request, + az_http_request const* request, az_http_response* ref_response) { _az_PRECONDITION_NOT_NULL(ref_curl); @@ -598,7 +598,7 @@ static AZ_NODISCARD az_result _az_http_client_curl_send_request_impl_process( } AZ_NODISCARD az_result -az_http_client_send_request(az_http_request const* const request, az_http_response* ref_response) +az_http_client_send_request(az_http_request const* request, az_http_response* ref_response) { _az_PRECONDITION_NOT_NULL(request); _az_PRECONDITION_NOT_NULL(ref_response); diff --git a/sdk/src/azure/platform/az_nohttp.c b/sdk/src/azure/platform/az_nohttp.c index e3fb2caf8b..0e83785db5 100644 --- a/sdk/src/azure/platform/az_nohttp.c +++ b/sdk/src/azure/platform/az_nohttp.c @@ -6,7 +6,7 @@ #include AZ_NODISCARD az_result -az_http_client_send_request(az_http_request const* const request, az_http_response* ref_response) +az_http_client_send_request(az_http_request const* request, az_http_response* ref_response) { (void)request; (void)ref_response; From e00dadfa60d234e94a4d5d43bd1e0c0476965583 Mon Sep 17 00:00:00 2001 From: Dane Walton Date: Fri, 13 Nov 2020 13:46:23 -0800 Subject: [PATCH 2/3] revert local --- sdk/src/azure/core/az_span.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk/src/azure/core/az_span.c b/sdk/src/azure/core/az_span.c index 746e793448..aa9cb72169 100644 --- a/sdk/src/azure/core/az_span.c +++ b/sdk/src/azure/core/az_span.c @@ -915,7 +915,7 @@ AZ_NODISCARD int32_t _az_span_url_encode_calc_length(az_span source) _az_PRECONDITION_RANGE(0, az_span_size(source), INT32_MAX / 3); int32_t const source_size = az_span_size(source); - uint8_t const* src_ptr = az_span_ptr(source); + uint8_t const* const src_ptr = az_span_ptr(source); int32_t encoded_length = source_size; for (int32_t i = 0; i < source_size; i++) From 9f79ca8fe76fec0bec704e1d1ec2144fbdd05c9e Mon Sep 17 00:00:00 2001 From: Dane Walton Date: Fri, 13 Nov 2020 14:12:27 -0800 Subject: [PATCH 3/3] clang format --- sdk/src/azure/core/az_context.c | 6 ++---- sdk/src/azure/core/az_http_request.c | 6 ++---- sdk/src/azure/core/az_json_token.c | 12 ++++-------- sdk/src/azure/core/az_json_writer.c | 3 +-- sdk/src/azure/platform/az_curl.c | 5 ++--- 5 files changed, 11 insertions(+), 21 deletions(-) diff --git a/sdk/src/azure/core/az_context.c b/sdk/src/azure/core/az_context.c index fd9c12b734..09e4ddd0eb 100644 --- a/sdk/src/azure/core/az_context.c +++ b/sdk/src/azure/core/az_context.c @@ -63,10 +63,8 @@ az_context_create_with_expiration(az_context const* parent, int64_t expiration) return (az_context){ ._internal = { .parent = parent, .expiration = expiration } }; } -AZ_NODISCARD az_context az_context_create_with_value( - az_context const* parent, - void const* key, - void const* value) +AZ_NODISCARD az_context +az_context_create_with_value(az_context const* parent, void const* key, void const* value) { _az_PRECONDITION_NOT_NULL(parent); _az_PRECONDITION_NOT_NULL(key); diff --git a/sdk/src/azure/core/az_http_request.c b/sdk/src/azure/core/az_http_request.c index 51ec138d26..5288971448 100644 --- a/sdk/src/azure/core/az_http_request.c +++ b/sdk/src/azure/core/az_http_request.c @@ -183,8 +183,7 @@ az_http_request_get_method(az_http_request const* request, az_http_method* out_m return AZ_OK; } -AZ_NODISCARD az_result -az_http_request_get_url(az_http_request const* request, az_span* out_url) +AZ_NODISCARD az_result az_http_request_get_url(az_http_request const* request, az_span* out_url) { _az_PRECONDITION_NOT_NULL(request); _az_PRECONDITION_NOT_NULL(out_url); @@ -194,8 +193,7 @@ az_http_request_get_url(az_http_request const* request, az_span* out_url) return AZ_OK; } -AZ_NODISCARD az_result -az_http_request_get_body(az_http_request const* request, az_span* out_body) +AZ_NODISCARD az_result az_http_request_get_body(az_http_request const* request, az_span* out_body) { _az_PRECONDITION_NOT_NULL(request); _az_PRECONDITION_NOT_NULL(out_body); diff --git a/sdk/src/azure/core/az_json_token.c b/sdk/src/azure/core/az_json_token.c index a87a5da9b1..f4852f6dbd 100644 --- a/sdk/src/azure/core/az_json_token.c +++ b/sdk/src/azure/core/az_json_token.c @@ -243,8 +243,7 @@ AZ_NODISCARD bool az_json_token_is_text_equal( return az_span_size(expected_text) == 0; } -AZ_NODISCARD az_result -az_json_token_get_boolean(az_json_token const* json_token, bool* out_value) +AZ_NODISCARD az_result az_json_token_get_boolean(az_json_token const* json_token, bool* out_value) { _az_PRECONDITION_NOT_NULL(json_token); _az_PRECONDITION_NOT_NULL(out_value); @@ -499,8 +498,7 @@ az_json_token_get_uint32(az_json_token const* json_token, uint32_t* out_value) return az_span_atou32(az_span_slice(scratch, 0, _az_span_diff(remainder, scratch)), out_value); } -AZ_NODISCARD az_result -az_json_token_get_int64(az_json_token const* json_token, int64_t* out_value) +AZ_NODISCARD az_result az_json_token_get_int64(az_json_token const* json_token, int64_t* out_value) { _az_PRECONDITION_NOT_NULL(json_token); _az_PRECONDITION_NOT_NULL(out_value); @@ -534,8 +532,7 @@ az_json_token_get_int64(az_json_token const* json_token, int64_t* out_value) return az_span_atoi64(az_span_slice(scratch, 0, _az_span_diff(remainder, scratch)), out_value); } -AZ_NODISCARD az_result -az_json_token_get_int32(az_json_token const* json_token, int32_t* out_value) +AZ_NODISCARD az_result az_json_token_get_int32(az_json_token const* json_token, int32_t* out_value) { _az_PRECONDITION_NOT_NULL(json_token); _az_PRECONDITION_NOT_NULL(out_value); @@ -569,8 +566,7 @@ az_json_token_get_int32(az_json_token const* json_token, int32_t* out_value) return az_span_atoi32(az_span_slice(scratch, 0, _az_span_diff(remainder, scratch)), out_value); } -AZ_NODISCARD az_result -az_json_token_get_double(az_json_token const* json_token, double* out_value) +AZ_NODISCARD az_result az_json_token_get_double(az_json_token const* json_token, double* out_value) { _az_PRECONDITION_NOT_NULL(json_token); _az_PRECONDITION_NOT_NULL(out_value); diff --git a/sdk/src/azure/core/az_json_writer.c b/sdk/src/azure/core/az_json_writer.c index d962dc265d..65b9d35a12 100644 --- a/sdk/src/azure/core/az_json_writer.c +++ b/sdk/src/azure/core/az_json_writer.c @@ -136,8 +136,7 @@ static AZ_NODISCARD bool _az_is_appending_value_valid(az_json_writer const* json } #ifndef AZ_NO_PRECONDITION_CHECKING -static AZ_NODISCARD bool _az_is_appending_property_name_valid( - az_json_writer const* json_writer) +static AZ_NODISCARD bool _az_is_appending_property_name_valid(az_json_writer const* json_writer) { _az_PRECONDITION_NOT_NULL(json_writer); diff --git a/sdk/src/azure/platform/az_curl.c b/sdk/src/azure/platform/az_curl.c index 8c017a3d92..fff9e50ce3 100644 --- a/sdk/src/azure/platform/az_curl.c +++ b/sdk/src/azure/platform/az_curl.c @@ -215,9 +215,8 @@ _az_http_client_curl_add_expect_header(CURL* ref_curl, struct curl_slist** ref_l * @param ref_headers list of headers in curl specific list * @return az_result */ -static AZ_NODISCARD az_result _az_http_client_curl_build_headers( - az_http_request const* request, - struct curl_slist** ref_headers) +static AZ_NODISCARD az_result +_az_http_client_curl_build_headers(az_http_request const* request, struct curl_slist** ref_headers) { _az_PRECONDITION_NOT_NULL(request);