Skip to content

[Build] Refactor more code to adhere to stricter build warnings#444

Open
VivekPanyam wants to merge 1 commit intomultiprocess_cc_warningsfrom
misc_cc_warnings
Open

[Build] Refactor more code to adhere to stricter build warnings#444
VivekPanyam wants to merge 1 commit intomultiprocess_cc_warningsfrom
misc_cc_warnings

Conversation

@VivekPanyam
Copy link
Copy Markdown
Collaborator

Summary:

Refactor additional code (mostly under source/neuropod/bindings) to adhere to the stricter set of warnings introduced in #437

Test Plan:

CI

@codecov
Copy link
Copy Markdown

codecov Bot commented Sep 22, 2020

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 88.23%. Comparing base (63939bd) to head (2bbbef0).

Additional details and impacted files
@@                    Coverage Diff                    @@
##           multiprocess_cc_warnings     #444   +/-   ##
=========================================================
  Coverage                     88.23%   88.23%           
=========================================================
  Files                           102      102           
  Lines                          6356     6358    +2     
=========================================================
+ Hits                           5608     5610    +2     
  Misses                          748      748           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

{

std::string get_cwd()
static std::string get_cwd()
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

asked already about static in other review

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

maybe anonymous namespace instead of detail will work here instead of "static"

void serialize(boost::archive::binary_oarchive &out, const NeuropodValueMap &item)
{
int num_items = item.size();
auto num_items = static_cast<int>(item.size());
Copy link
Copy Markdown
Contributor

@vkuzmin-uber vkuzmin-uber Sep 22, 2020

Choose a reason for hiding this comment

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

is it supposed to be int here? Or this is for backward compatibility with existing models? Maybe "unsigned int" can be used in this case (but need to keep it in sync with deserialize?

Anyway, if you decide to use int, consider using boost::numeric_cast, this is for safe conversion in case like this one

Copy link
Copy Markdown
Contributor

@vkuzmin-uber vkuzmin-uber left a comment

Choose a reason for hiding this comment

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

Looks good. One comment about serialization, please check

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.

3 participants