From 7c30a7b80f64cc8403c76bb2e135a9f982e52e46 Mon Sep 17 00:00:00 2001 From: Yury Melnichek Date: Wed, 20 Mar 2013 00:03:07 +0100 Subject: [PATCH] [api] Change the order or parameters. --- api/src/c/api-client.c | 2 +- api/tests/c/api-client-test.c | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/api/src/c/api-client.c b/api/src/c/api-client.c index ffb1023e31..8935993ab1 100644 --- a/api/src/c/api-client.c +++ b/api/src/c/api-client.c @@ -45,7 +45,7 @@ int MapsWithMe_LonToInt(double lon, int maxValue) return (x <= 0 || x >= maxValue + 1) ? 0 : (int)x; } -void MapsWithMe_LatLonToString(double lat, double lon, int nBytes, char * s) +void MapsWithMe_LatLonToString(double lat, double lon, char * s, int nBytes) { if (nBytes > MAPSWITHME_MAX_POINT_BYTES) nBytes = MAPSWITHME_MAX_POINT_BYTES; diff --git a/api/tests/c/api-client-test.c b/api/tests/c/api-client-test.c index 86e4c4373d..ba74e164c1 100644 --- a/api/tests/c/api-client-test.c +++ b/api/tests/c/api-client-test.c @@ -5,7 +5,7 @@ char MapsWithMe_Base64Char(int x); int MapsWithMe_LatToInt(double lat, int maxValue); double MapsWithMe_LonIn180180(double lon); int MapsWithMe_LonToInt(double lon, int maxValue); -void MapsWithMe_LatLonToString(double lat, double lon, int nBytes, char * s); +void MapsWithMe_LatLonToString(double lat, double lon, char * s, int nBytes); static const int MAX_POINT_BYTES = 10; static const int TEST_COORD_BYTES = 9; @@ -13,7 +13,7 @@ static const int TEST_COORD_BYTES = 9; char const * TestLatLonToStr(double lat, double lon) { static char s[TEST_COORD_BYTES + 1] = {0}; - MapsWithMe_LatLonToString(lat, lon, TEST_COORD_BYTES, s); + MapsWithMe_LatLonToString(lat, lon, s, TEST_COORD_BYTES); return s; } @@ -196,13 +196,13 @@ FCT_BGN() for (double lon = -190; lon < 190; lon += 0.9) { char prevStepS[MAX_POINT_BYTES + 1] = {0}; - MapsWithMe_LatLonToString(lat, lon, MAX_POINT_BYTES, prevStepS); + MapsWithMe_LatLonToString(lat, lon, prevStepS, MAX_POINT_BYTES); for (int len = MAX_POINT_BYTES - 1; len > 0; --len) { // Test that the current string is a prefix of the previous one. char s[MAX_POINT_BYTES] = {0}; - MapsWithMe_LatLonToString(lat, lon, len, s); + MapsWithMe_LatLonToString(lat, lon, s, len); prevStepS[len] = 0; fct_chk_eq_str(s, prevStepS); } @@ -225,7 +225,7 @@ FCT_BGN() for (double lon = -180; lon < 180; lon += 0.05) { char s[3] = {0}; - MapsWithMe_LatLonToString(lat, lon, 2, s); + MapsWithMe_LatLonToString(lat, lon, s, 2); ++num1[b64toI[s[0]]]; ++num2[b64toI[s[0]]][b64toI[s[1]]]; }