From 83d8df4ae22871cec309ae533fc542e3e4114649 Mon Sep 17 00:00:00 2001 From: Anton Kolesnyk Date: Fri, 1 Nov 2024 17:25:37 -0700 Subject: [PATCH 1/3] Minor code cleanups --- .../src/amqp/private/claims_based_security_impl.hpp | 2 -- sdk/core/azure-core/src/base64.cpp | 9 --------- sdk/core/azure-core/src/datetime.cpp | 1 - sdk/core/azure-core/src/http/curl/curl.cpp | 12 ------------ sdk/core/azure-core/src/http/http.cpp | 2 -- sdk/core/azure-core/src/http/log_policy.cpp | 3 --- 6 files changed, 29 deletions(-) diff --git a/sdk/core/azure-core-amqp/src/amqp/private/claims_based_security_impl.hpp b/sdk/core/azure-core-amqp/src/amqp/private/claims_based_security_impl.hpp index 87a7a2b54c..1f93eadf8f 100644 --- a/sdk/core/azure-core-amqp/src/amqp/private/claims_based_security_impl.hpp +++ b/sdk/core/azure-core-amqp/src/amqp/private/claims_based_security_impl.hpp @@ -22,8 +22,6 @@ namespace Azure { namespace Core { namespace Amqp { namespace _detail { }}}} // namespace Azure::Core::Amqp::_detail namespace Azure { namespace Core { namespace Amqp { namespace _detail { - using UniqueAmqpCbsHandle = UniqueHandle; - class ClaimsBasedSecurityImpl final : public _internal::ManagementClientEvents { public: diff --git a/sdk/core/azure-core/src/base64.cpp b/sdk/core/azure-core/src/base64.cpp index e1a3a2e7a0..5e4be1c62a 100644 --- a/sdk/core/azure-core/src/base64.cpp +++ b/sdk/core/azure-core/src/base64.cpp @@ -3,8 +3,6 @@ #include "azure/core/base64.hpp" -#include "azure/core/platform.hpp" - #include #include @@ -336,15 +334,11 @@ std::string Base64Encode(uint8_t const* const data, size_t length) { int32_t result = Base64EncodeAndPadTwo(&data[sourceIndex]); Base64WriteIntAsFourBytes(destination, result); - destination += 4; - sourceIndex += 1; } else if (sourceIndex + 2 == inputSize) { int32_t result = Base64EncodeAndPadOne(&data[sourceIndex]); Base64WriteIntAsFourBytes(destination, result); - destination += 4; - sourceIndex += 2; } return encodedResult; @@ -453,7 +447,6 @@ std::vector Base64Decode(const std::string& text) } Base64WriteThreeLowOrderBytes(destinationPtr, i0); - destinationPtr += 3; } else if (i2 != EncodingPad) { @@ -469,7 +462,6 @@ std::vector Base64Decode(const std::string& text) destinationPtr[1] = static_cast(i0 >> 8); destinationPtr[0] = static_cast(i0 >> 16); - destinationPtr += 2; } else { @@ -479,7 +471,6 @@ std::vector Base64Decode(const std::string& text) } destinationPtr[0] = static_cast(i0 >> 16); - destinationPtr += 1; } return destination; diff --git a/sdk/core/azure-core/src/datetime.cpp b/sdk/core/azure-core/src/datetime.cpp index 0869ae57c0..be54dbacdf 100644 --- a/sdk/core/azure-core/src/datetime.cpp +++ b/sdk/core/azure-core/src/datetime.cpp @@ -4,7 +4,6 @@ #include "azure/core/datetime.hpp" #include "azure/core/internal/strings.hpp" -#include "azure/core/platform.hpp" #include #include diff --git a/sdk/core/azure-core/src/http/curl/curl.cpp b/sdk/core/azure-core/src/http/curl/curl.cpp index c111231743..40c9efadf5 100644 --- a/sdk/core/azure-core/src/http/curl/curl.cpp +++ b/sdk/core/azure-core/src/http/curl/curl.cpp @@ -14,21 +14,9 @@ #endif #endif -#include "azure/core/platform.hpp" - -#if defined(AZ_PLATFORM_WINDOWS) -#if !defined(WIN32_LEAN_AND_MEAN) -#define WIN32_LEAN_AND_MEAN -#endif -#if !defined(NOMINMAX) -#define NOMINMAX -#endif -#endif - #include "azure/core/http/curl_transport.hpp" #include "azure/core/http/http.hpp" #include "azure/core/http/policies/policy.hpp" -#include "azure/core/http/transport.hpp" #include "azure/core/internal/diagnostics/log.hpp" #include "azure/core/internal/strings.hpp" diff --git a/sdk/core/azure-core/src/http/http.cpp b/sdk/core/azure-core/src/http/http.cpp index 6f2862bdb9..5d5fa3a171 100644 --- a/sdk/core/azure-core/src/http/http.cpp +++ b/sdk/core/azure-core/src/http/http.cpp @@ -3,13 +3,11 @@ #include "azure/core/http/http.hpp" -#include "azure/core/http/policies/policy.hpp" #include "azure/core/internal/strings.hpp" #include "azure/core/url.hpp" #include #include -#include using namespace Azure::Core; using namespace Azure::Core::Http; diff --git a/sdk/core/azure-core/src/http/log_policy.cpp b/sdk/core/azure-core/src/http/log_policy.cpp index 7a5f989926..16063ef079 100644 --- a/sdk/core/azure-core/src/http/log_policy.cpp +++ b/sdk/core/azure-core/src/http/log_policy.cpp @@ -4,11 +4,8 @@ #include "azure/core/http/policies/policy.hpp" #include "azure/core/internal/diagnostics/log.hpp" -#include #include -#include #include -#include using Azure::Core::Context; using namespace Azure::Core; From 68d4989e9e30f40648bb35fb53d2f6a8d802130f Mon Sep 17 00:00:00 2001 From: Anton Kolesnyk <41349689+antkmsft@users.noreply.github.com> Date: Mon, 4 Nov 2024 11:33:41 -0800 Subject: [PATCH 2/3] Update claims_based_security_impl.hpp Undo UniqueAmqpCbsHandle removal - it is right, but will create problems for Larry working in a feature branch when merging it back. --- .../src/amqp/private/claims_based_security_impl.hpp | 1 + 1 file changed, 1 insertion(+) diff --git a/sdk/core/azure-core-amqp/src/amqp/private/claims_based_security_impl.hpp b/sdk/core/azure-core-amqp/src/amqp/private/claims_based_security_impl.hpp index 1f93eadf8f..6911c5636e 100644 --- a/sdk/core/azure-core-amqp/src/amqp/private/claims_based_security_impl.hpp +++ b/sdk/core/azure-core-amqp/src/amqp/private/claims_based_security_impl.hpp @@ -22,6 +22,7 @@ namespace Azure { namespace Core { namespace Amqp { namespace _detail { }}}} // namespace Azure::Core::Amqp::_detail namespace Azure { namespace Core { namespace Amqp { namespace _detail { + using UniqueAmqpCbsHandle = UniqueHandle; class ClaimsBasedSecurityImpl final : public _internal::ManagementClientEvents { public: From 2344f8d5f297db8e3f3f033c18b127d7deaa41c3 Mon Sep 17 00:00:00 2001 From: Anton Kolesnyk <41349689+antkmsft@users.noreply.github.com> Date: Mon, 4 Nov 2024 11:34:06 -0800 Subject: [PATCH 3/3] Update claims_based_security_impl.hpp --- .../src/amqp/private/claims_based_security_impl.hpp | 1 + 1 file changed, 1 insertion(+) diff --git a/sdk/core/azure-core-amqp/src/amqp/private/claims_based_security_impl.hpp b/sdk/core/azure-core-amqp/src/amqp/private/claims_based_security_impl.hpp index 6911c5636e..87a7a2b54c 100644 --- a/sdk/core/azure-core-amqp/src/amqp/private/claims_based_security_impl.hpp +++ b/sdk/core/azure-core-amqp/src/amqp/private/claims_based_security_impl.hpp @@ -23,6 +23,7 @@ namespace Azure { namespace Core { namespace Amqp { namespace _detail { namespace Azure { namespace Core { namespace Amqp { namespace _detail { using UniqueAmqpCbsHandle = UniqueHandle; + class ClaimsBasedSecurityImpl final : public _internal::ManagementClientEvents { public: