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

[3.2] fix compile warnings in trace_api_plugin #35

Merged
merged 6 commits into from
Aug 26, 2022

Conversation

linh2931
Copy link
Member

Resolve #21

Fix the following warnings:

plugins/trace_api_plugin/compressed_file.cpp:138:66: warning:   comparison of integer  expressions of different signedness: ‘std::__tuple_element_t<0,   std::tuple<long unsigned  int, long unsigned int> >’ {aka ‘long unsigned int’} and ‘long int’ [-Wsign-compare]

plugins/trace_api_plugin/compressed_file.cpp:289:30: warning:   comparison of integer  expressions of different signedness: ‘int’ and ‘const long  unsigned int’ [-Wsign-compare]

trace_api_plugin/trace_api_plugin.cpp:363:12: warning:  variable ‘cfg_options’ set but not used [-Wunused-but-set-variable]

@@ -360,7 +360,7 @@ struct trace_api_plugin_impl {
:common(common) {}

static void set_program_options(appbase::options_description& cli, appbase::options_description& cfg) {
auto cfg_options = cfg.add_options();
cfg.add_options();
Copy link
Member

Choose a reason for hiding this comment

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

Can this line just be entirely removed?

Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks! The whole function trace_api_plugin_impl::trace_api_plugin_impl can be removed.

@@ -109,7 +109,7 @@ struct compressed_file_impl {
}
}

void seek( long loc, fc::cfile& file ) {
void seek( uint64_t loc, fc::cfile& file ) {
Copy link
Member

Choose a reason for hiding this comment

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

Does it make sense to change the long remaining = loc to uint64_t remaining = loc? It's not a warning but it may be worthwhile keeping the types the same as they were before

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, that is even better. Will change it to auto remaining = loc;

@linh2931 linh2931 merged commit 3779056 into main Aug 26, 2022
@linh2931 linh2931 deleted the trace_api_plugin_warnings_fixes branch August 26, 2022 22:51
heifner pushed a commit that referenced this pull request Apr 29, 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.

Compile warnings in trace_api_plugin
2 participants