Skip to content

Commit

Permalink
*: Change typedef to using
Browse files Browse the repository at this point in the history
Changes typedef to using in places where C compatibility isn't
necessary.

Change-Id: I5661a0ba2b8355a267b8c451f3f2fd0539995c94
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/230351
Lint: Lint 🤖 <android-build-ayeaye@system.gserviceaccount.com>
Pigweed-Auto-Submit: Armando Montanez <amontanez@google.com>
Commit-Queue: Auto-Submit <auto-submit@pigweed-service-accounts.iam.gserviceaccount.com>
Reviewed-by: Wyatt Hepler <hepler@google.com>
  • Loading branch information
armandomontanez authored and CQ Bot Account committed Aug 16, 2024
1 parent d97c162 commit 7654e11
Show file tree
Hide file tree
Showing 9 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion pw_assert_basic/basic_handler.cc
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ static void WriteLine(std::string_view s) {
.IgnoreError(); // TODO: b/242598609 - Handle Status properly
}

typedef pw::StringBuffer<150> Buffer;
using Buffer = pw::StringBuffer<150>;

extern "C" void pw_assert_basic_HandleFailure(const char* file_name,
int line_number,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ enum MetadataVersion : uint32_t {

// Technically the original BlobMetadataV1 was not packed.
PW_PACKED(struct) BlobMetadataV1 {
typedef uint32_t ChecksumValue;
using ChecksumValue = uint32_t;

// The checksum of the blob data stored in flash.
ChecksumValue checksum;
Expand Down
4 changes: 2 additions & 2 deletions pw_chre/include/chre/target_platform/atomic_base.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class AtomicBase {
std::atomic<AtomicType> atomic_;
};

typedef AtomicBase<bool> AtomicBoolBase;
typedef AtomicBase<uint32_t> AtomicUint32Base;
using AtomicBoolBase = AtomicBase<bool>;
using AtomicUint32Base = AtomicBase<uint32_t>;

} // namespace chre
2 changes: 1 addition & 1 deletion pw_chre/public/pw_chre/host_link.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ namespace pw::chre {

/// This is a token representing a message that CHRE allocated.
/// It must be passed to `FreeMessageToAp` when the message is finished.
typedef const void* MessageToApContext;
using MessageToApContext = const void*;

/// This is a message that should be sent to the AP.
/// It was allocated by CHRE, so pw::chre::FreeMessageToAp should be called
Expand Down
2 changes: 1 addition & 1 deletion pw_crypto/public/pw_crypto/sha256_mbedtls.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,6 @@

namespace pw::crypto::sha256::backend {

typedef mbedtls_sha256_context NativeSha256Context;
using NativeSha256Context = mbedtls_sha256_context;

} // namespace pw::crypto::sha256::backend
2 changes: 1 addition & 1 deletion pw_kvs/public/pw_kvs/flash_memory.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ enum class PartitionPermission : bool {
class FlashMemory {
public:
// The flash address is in the range of: 0 to FlashSize.
typedef uint32_t Address;
using Address = uint32_t;

// TODO: b/235149326 - This can be constexpr when tokenized asserts are fixed.
FlashMemory(size_t sector_size,
Expand Down
2 changes: 1 addition & 1 deletion pw_rpc/nanopb/client_server_context_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class TestService final : public GeneratedService::Service<TestService> {

Status TestAnotherUnaryRpc(const pw_rpc_test_TestRequest& request,
pw_rpc_test_TestResponse& response) {
typedef std::array<uint32_t, 3> ArgType;
using ArgType = std::array<uint32_t, 3>;
// The values array needs to be kept in memory until after this method call
// returns since the response is not encoded until after returning from this
// method.
Expand Down
2 changes: 1 addition & 1 deletion pw_rpc/nanopb/client_server_context_threaded_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class TestService final : public GeneratedService::Service<TestService> {

Status TestAnotherUnaryRpc(const pw_rpc_test_TestRequest& request,
pw_rpc_test_TestResponse& response) {
typedef std::array<uint32_t, 3> ArgType;
using ArgType = std::array<uint32_t, 3>;
// The values array needs to be kept in memory until after this method call
// returns since the response is not encoded until after returning from this
// method.
Expand Down
2 changes: 1 addition & 1 deletion pw_rpc/nanopb/server_callback_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class TestServiceImpl final

Status TestAnotherUnaryRpc(const pw_rpc_test_TestRequest&,
pw_rpc_test_TestResponse& response) {
typedef std::array<uint32_t, 3> ArgType;
using ArgType = std::array<uint32_t, 3>;
// The values array needs to be kept in memory until after this method call
// returns since the response is not encoded until after returning from this
// method.
Expand Down

0 comments on commit 7654e11

Please sign in to comment.