Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

clean: apply clang-tidy's modernize-use-using (replace most typedef) #1908

Merged

Conversation

shenlebantongying
Copy link
Collaborator

@shenlebantongying shenlebantongying commented Nov 6, 2024

I feel using is a straight upgrade of typedef especially for long type names.

There is only 2 typedef left because that file is currently compiled as C.

@shenlebantongying shenlebantongying changed the title clean: mass apply clang-tidy's modernize-use-using (replace most typedef`) clean: mass apply clang-tidy's modernize-use-using (replace most typedef) Nov 6, 2024
@shenlebantongying shenlebantongying force-pushed the clean/tidy-using-using branch 2 times, most recently from 727aba0 to 1fcf48b Compare November 6, 2024 05:44
Comment on lines -118 to 132
typedef struct
struct bgl_block
{
unsigned type;
unsigned length;
char * data;
} bgl_block;
};

typedef struct
struct bgl_entry
{
std::string headword;
std::string definition;
std::string displayedHeadword;
std::vector< std::string > alternates;
} bgl_entry;
};

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In C++, there is no need to typedef again. The struct name can be directly used.

https://learn.microsoft.com/en-us/cpp/cpp/struct-cpp?view=msvc-170#using-a-structure

@shenlebantongying shenlebantongying changed the title clean: mass apply clang-tidy's modernize-use-using (replace most typedef) clean: apply clang-tidy's modernize-use-using (replace most typedef) Nov 6, 2024
@shenlebantongying shenlebantongying merged commit 8be7b65 into xiaoyifang:staged Nov 6, 2024
7 checks passed
@shenlebantongying shenlebantongying deleted the clean/tidy-using-using branch November 6, 2024 06:05
Copy link

sonarqubecloud bot commented Nov 6, 2024

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant