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

Refactors Existing Alternatives Architecture #4035

Merged
merged 2 commits into from
May 12, 2017
Merged

Conversation

daniel-j-h
Copy link
Member

Splitting off some required alternatives refactoring work to already target master. Functionality-wise nothing changes - but it lifts some restrictions to move forward in my mld alternatives work:

#3905

Note: the API needs to know that our alternatives impl. is using the via-method and therefore does not support queries with via nodes (only s,t queries) - would require some more re-structuring. I made a hard cut there.

@daniel-j-h daniel-j-h force-pushed the refactor-alternatives branch from 3534951 to 9339457 Compare May 11, 2017 17:32
Copy link
Contributor

@oxidase oxidase left a comment

Choose a reason for hiding this comment

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

👍 LGTM

@daniel-j-h daniel-j-h force-pushed the refactor-alternatives branch from 9339457 to e064a93 Compare May 12, 2017 11:54
@daniel-j-h daniel-j-h merged commit e064a93 into master May 12, 2017
@daniel-j-h daniel-j-h deleted the refactor-alternatives branch May 12, 2017 11:56
response.values["code"] = "Ok";
}

void MakeResponse(const InternalRouteResult &raw_route, util::json::Object &response) const
{
return MakeResponse(raw_route, response);
Copy link
Member

@danpat danpat May 17, 2017

Choose a reason for hiding this comment

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

This function calls itself infinitely.

Should this be return MakeResponse(InternalManyRoutesResult(raw_route), response); ?

Copy link
Member Author

Choose a reason for hiding this comment

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

Hm the InternalRouteResult should just silently convert to a InternalManyRouteResult, at least that was the plan. Not sure you're right because then basically no test would have run through. I will make a pr to change it to your suggestion - it's much clearer. Thanks for flagging!

Copy link
Member Author

Choose a reason for hiding this comment

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

Copy link
Member

Choose a reason for hiding this comment

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

I noticed because clang issues a warning 😀

Copy link
Member Author

Choose a reason for hiding this comment

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

Your local Clang or Clang 4 on Travis? Which warning is it? Can we enable it and -Werror on Travis? I want to catch these things asap and it looks like this was a serious issue.

Copy link
Member

Choose a reason for hiding this comment

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

/Users/danpat/mapbox/osrm-backend/include/engine/api/route_api.hpp:69:5: warning: all paths through this function will call itself [-Winfinite-recursion]
    {
    ^

I'm using clang from my local XCode install:

$ clang --version
Apple LLVM version 8.1.0 (clang-802.0.42)
Target: x86_64-apple-darwin16.5.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin

I have no idea how it maps to the upstream version, but it's from XCode 8.3.2.

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

Successfully merging this pull request may close these issues.

3 participants