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

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

Open
wants to merge 1 commit into
base: multiprocess_cc_warnings
Choose a base branch
from

Conversation

VivekPanyam
Copy link
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

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.

@@ -25,7 +25,7 @@ limitations under the License.
namespace detail
{

std::string get_cwd()
static std::string get_cwd()
Copy link
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
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"

@@ -88,7 +88,7 @@ std::shared_ptr<NeuropodValue> deserialize(boost::archive::binary_iarchive &ar,

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
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
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