aboutsummaryrefslogtreecommitdiff
path: root/src/pj_init.c
diff options
context:
space:
mode:
authorEven Rouault <even.rouault@spatialys.com>2015-06-28 18:29:23 +0200
committerEven Rouault <even.rouault@spatialys.com>2015-06-28 18:29:23 +0200
commit02232fd5fe58783a40a8cf124170d9ad4629b1ce (patch)
treed2bfb849bd3ad4d952bc8e5db0e859b8cef8d0d7 /src/pj_init.c
parentf89810c45ab97baf2847855eb6cd57619a806279 (diff)
parent6073f5f3d33d401a7140611b8f3570caf5d17a3b (diff)
downloadPROJ-02232fd5fe58783a40a8cf124170d9ad4629b1ce.tar.gz
PROJ-02232fd5fe58783a40a8cf124170d9ad4629b1ce.zip
Merge branch '4-warning-fixes' of github.com:QuLogic/proj.4
Diffstat (limited to 'src/pj_init.c')
-rw-r--r--src/pj_init.c19
1 files changed, 7 insertions, 12 deletions
diff --git a/src/pj_init.c b/src/pj_init.c
index 59bd2c88..622e80bf 100644
--- a/src/pj_init.c
+++ b/src/pj_init.c
@@ -1,6 +1,4 @@
/******************************************************************************
- * $Id$
- *
* Project: PROJ.4
* Purpose: Initialize projection object from string definition. Includes
* pj_init(), pj_init_plus() and pj_free() function.
@@ -37,8 +35,6 @@
#include <locale.h>
#include <ctype.h>
-PJ_CVSID("$Id$");
-
typedef struct {
projCtx ctx;
PAFile fid;
@@ -54,7 +50,7 @@ typedef struct {
static const char *fill_buffer(pj_read_state *state, const char *last_char)
{
size_t bytes_read;
- int char_remaining, char_requested;
+ size_t char_remaining, char_requested;
/* -------------------------------------------------------------------- */
/* Don't bother trying to read more if we are at eof, or if the */
@@ -414,16 +410,15 @@ pj_init_ctx(projCtx ctx, int argc, char **argv) {
/* put arguments into internal linked list */
if (argc <= 0) { pj_ctx_set_errno( ctx, -1 ); goto bum_call; }
- for (i = 0; i < argc; ++i)
- if (i)
- curr = curr->next = pj_mkparam(argv[i]);
- else
- start = curr = pj_mkparam(argv[i]);
+ start = curr = pj_mkparam(argv[0]);
+ for (i = 1; i < argc; ++i) {
+ curr->next = pj_mkparam(argv[i]);
+ curr = curr->next;
+ }
if (ctx->last_errno) goto bum_call;
/* check if +init present */
if (pj_param(ctx, start, "tinit").i) {
- paralist *last = curr;
int found_def = 0;
if (!(curr = get_init(ctx,&start, curr,
@@ -643,7 +638,7 @@ pj_init_ctx(projCtx ctx, int argc, char **argv) {
void
pj_free(PJ *P) {
if (P) {
- paralist *t = P->params, *n;
+ paralist *t, *n;
/* free parameter list elements */
for (t = P->params; t; t = n) {