Skip to content

Commit

Permalink
Fix build and test errors in previous commits
Browse files Browse the repository at this point in the history
  • Loading branch information
kbevers committed Jul 13, 2017
1 parent 353aea3 commit d921b40
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
8 changes: 5 additions & 3 deletions src/PJ_cart.c
Original file line number Diff line number Diff line change
Expand Up @@ -492,16 +492,18 @@ int pj_cart_selftest (void) {
proj_destroy(P);

/* test proj_rtodms() and proj_dmstor() */
if (!strcmp("180dN", proj_rtodms(buf, M_PI, 'N', 'S')))
if (strcmp("180dN", proj_rtodms(buf, M_PI, 'N', 'S'))) {
return 70;
}

if (proj_dmstor(&buf[0], NULL) != M_PI)
return 71;

if (!strcmp("114d35'29.612\"S", proj_rtodms(buf, -2.0, 'N', 'S')))
if (strcmp("114d35'29.612\"S", proj_rtodms(buf, -2.0, 'N', 'S')))
return 72;

if (proj_dmstor(&buf[0], NULL) != -2.0)
/* we can't expect perfect numerical accuracy so testing with a tolerance */
if (fabs(-2.0 - proj_dmstor(&buf[0], NULL)) > 1e-7)
return 73;


Expand Down
9 changes: 6 additions & 3 deletions src/pj_obs_api.c
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,8 @@ int proj_transform_obs (PJ *P, enum proj_direction direction, size_t n, PJ_OBS *
Returns 0 if all observations are transformed without error, otherwise
returns error number.
******************************************************************************/
for (int i=0; i<n; i++) {
size_t i;
for (i=0; i<n; i++) {
obs[i] = proj_trans_obs(P, direction, obs[i]);
if (proj_errno(P))
return proj_errno(P);
Expand All @@ -344,7 +345,9 @@ int proj_transform_coord (PJ *P, enum proj_direction direction, size_t n, PJ_COO
Returns 0 if all coordinates are transformed without error, otherwise
returns error number.
******************************************************************************/
for (int i=0; i<n; i++) {
size_t i;

for (i=0; i<n; i++) {
coord[i] = proj_trans_coord(P, direction, coord[i]);
if (proj_errno(P))
return proj_errno(P);
Expand Down Expand Up @@ -392,7 +395,7 @@ PJ *proj_create_crs_to_crs (PJ_CONTEXT *ctx, const char *srid_from, const char
char buffer[256];

sprintf(buffer, "+proj=pipeline +step +init=%s +inv +step +init=%s", srid_from, srid_to);
P = proj_create(0, buffer);
P = proj_create(ctx, buffer);

return P;
}
Expand Down

0 comments on commit d921b40

Please sign in to comment.