Skip to content

Commit

Permalink
Fixed typo in flatbuffers: longitute -> longitude.
Browse files Browse the repository at this point in the history
  • Loading branch information
Denis Chaplygin committed Aug 26, 2019
1 parent b8182dd commit 0be87c7
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion features/step_definitions/nearest.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ module.exports = function () {
var fb = FBResult.getRootAsFBResult(buf);
var location = fb.waypoints(0).location();

coord = [location.longitute(), location.latitude()];
coord = [location.longitude(), location.latitude()];

var got = { in: row.in, out: row.out };

Expand Down
8 changes: 4 additions & 4 deletions features/support/fbresult_generated.js
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ osrm.engine.api.fbresult.Position.prototype.__init = function(i, bb) {
/**
* @returns {number}
*/
osrm.engine.api.fbresult.Position.prototype.longitute = function() {
osrm.engine.api.fbresult.Position.prototype.longitude = function() {
return this.bb.readFloat32(this.bb_pos);
};

Expand All @@ -140,14 +140,14 @@ osrm.engine.api.fbresult.Position.prototype.latitude = function() {

/**
* @param {flatbuffers.Builder} builder
* @param {number} longitute
* @param {number} longitude
* @param {number} latitude
* @returns {flatbuffers.Offset}
*/
osrm.engine.api.fbresult.Position.createPosition = function(builder, longitute, latitude) {
osrm.engine.api.fbresult.Position.createPosition = function(builder, longitude, latitude) {
builder.prep(4, 8);
builder.writeFloat32(latitude);
builder.writeFloat32(longitute);
builder.writeFloat32(longitude);
return builder.offset();
};

Expand Down
10 changes: 5 additions & 5 deletions include/engine/api/flatbuffers/fbresult_generated.h
Original file line number Diff line number Diff line change
Expand Up @@ -176,19 +176,19 @@ inline const char *EnumNameTurn(Turn e) {

FLATBUFFERS_MANUALLY_ALIGNED_STRUCT(4) Position FLATBUFFERS_FINAL_CLASS {
private:
float longitute_;
float longitude_;
float latitude_;

public:
Position() {
memset(static_cast<void *>(this), 0, sizeof(Position));
}
Position(float _longitute, float _latitude)
: longitute_(flatbuffers::EndianScalar(_longitute)),
Position(float _longitude, float _latitude)
: longitude_(flatbuffers::EndianScalar(_longitude)),
latitude_(flatbuffers::EndianScalar(_latitude)) {
}
float longitute() const {
return flatbuffers::EndianScalar(longitute_);
float longitude() const {
return flatbuffers::EndianScalar(longitude_);
}
float latitude() const {
return flatbuffers::EndianScalar(latitude_);
Expand Down
2 changes: 1 addition & 1 deletion include/engine/api/flatbuffers/position.fbs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
namespace osrm.engine.api.fbresult;

struct Position {
longitute: float;
longitude: float;
latitude: float;
}
4 changes: 2 additions & 2 deletions unit_tests/library/route.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -503,7 +503,7 @@ BOOST_AUTO_TEST_CASE(test_route_serialize_fb)

for (const auto &waypoint : *waypoints)
{
const auto longitude = waypoint->location()->longitute();
const auto longitude = waypoint->location()->longitude();
const auto latitude = waypoint->location()->latitude();
BOOST_CHECK(longitude >= -180. && longitude <= 180.);
BOOST_CHECK(latitude >= -90. && latitude <= 90.);
Expand Down Expand Up @@ -548,7 +548,7 @@ BOOST_AUTO_TEST_CASE(test_route_serialize_fb)

for (auto intersection : *intersections)
{
const auto longitude = intersection->location()->longitute();
const auto longitude = intersection->location()->longitude();
const auto latitude = intersection->location()->latitude();
BOOST_CHECK(longitude >= -180. && longitude <= 180.);
BOOST_CHECK(latitude >= -90. && latitude <= 90.);
Expand Down
2 changes: 1 addition & 1 deletion unit_tests/library/waypoint_check.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ inline bool waypoint_check(json::Value waypoint)

inline bool waypoint_check(const osrm::engine::api::fbresult::Waypoint *const waypoint)
{
util::FloatLongitude lon{waypoint->location()->longitute()};
util::FloatLongitude lon{waypoint->location()->longitude()};
util::FloatLatitude lat{waypoint->location()->latitude()};
util::Coordinate location_coordinate(lon, lat);
return location_coordinate.IsValid();
Expand Down

0 comments on commit 0be87c7

Please sign in to comment.