aboutsummaryrefslogtreecommitdiff
path: root/src/gie.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/gie.c')
-rw-r--r--src/gie.c24
1 files changed, 17 insertions, 7 deletions
diff --git a/src/gie.c b/src/gie.c
index d5c5ee8b..0ace96d0 100644
--- a/src/gie.c
+++ b/src/gie.c
@@ -386,8 +386,11 @@ static int process_file (const char *fname) {
T.op_ko = T.total_ko = 0;
T.op_skip = T.total_skip = 0;
- if (T.skip)
- return proj_destroy (T.P), T.P = 0, 0;
+ if (T.skip) {
+ proj_destroy (T.P);
+ T.P = 0;
+ return 0;
+ }
f = fopen (fname, "rt");
if (0==f) {
@@ -404,8 +407,11 @@ static int process_file (const char *fname) {
T.curr_file = fname;
while (get_inp(F)) {
- if (SKIP==dispatch (F->tag, F->args))
- return proj_destroy (T.P), T.P = 0, 0;
+ if (SKIP==dispatch (F->tag, F->args)) {
+ proj_destroy (T.P);
+ T.P = 0;
+ return 0;
+ }
}
fclose (f);
@@ -639,7 +645,8 @@ static PJ_COORD torad_coord (PJ *P, PJ_DIRECTION dir, PJ_COORD a) {
paralist *l = pj_param_exists (P->params, "axis");
if (l && dir==PJ_INV)
axis = l->param + strlen ("axis=");
- for (i = 0, n = strlen (axis); i < n; i++)
+ n = strlen (axis);
+ for (i = 0; i < n; i++)
if (strchr ("news", axis[i]))
a.v[i] = proj_torad (a.v[i]);
return a;
@@ -652,7 +659,8 @@ static PJ_COORD todeg_coord (PJ *P, PJ_DIRECTION dir, PJ_COORD a) {
paralist *l = pj_param_exists (P->params, "axis");
if (l && dir==PJ_FWD)
axis = l->param + strlen ("axis=");
- for (i = 0, n = strlen (axis); i < n; i++)
+ n = strlen (axis);
+ for (i = 0; i < n; i++)
if (strchr ("news", axis[i]))
a.v[i] = proj_todeg (a.v[i]);
return a;
@@ -669,7 +677,8 @@ Attempt to interpret args as a PJ_COORD.
const char *endp, *prev = args;
PJ_COORD a = proj_coord (0,0,0,0);
- for (i = 0, T.dimensions_given = 0; i < 4; i++, T.dimensions_given++) {
+ T.dimensions_given = 0;
+ for (i = 0; i < 4; i++) {
double d = proj_strtod (prev, (char **) &endp);
/* Break out if there were no more numerals */
@@ -678,6 +687,7 @@ Attempt to interpret args as a PJ_COORD.
a.v[i] = d;
prev = endp;
+ T.dimensions_given++;
}
return a;