aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorFrank Warmerdam <warmerdam@pobox.com>2013-06-22 17:07:33 +0000
committerFrank Warmerdam <warmerdam@pobox.com>2013-06-22 17:07:33 +0000
commitc53a09219715a12fe61473e3e1df82d59507f07a (patch)
treec63f3259870ac188eb2af909bc35f932bff79f5c /src
parent47ed7427c8c87229963eba585408b690082e2f72 (diff)
downloadPROJ-c53a09219715a12fe61473e3e1df82d59507f07a.tar.gz
PROJ-c53a09219715a12fe61473e3e1df82d59507f07a.zip
upgrade to the new file api
git-svn-id: http://svn.osgeo.org/metacrs/proj/trunk@2348 4e78687f-474d-0410-85f9-8d5e500ac6b2
Diffstat (limited to 'src')
-rw-r--r--src/pj_gc_reader.c23
-rw-r--r--src/pj_gridcatalog.c1
2 files changed, 12 insertions, 12 deletions
diff --git a/src/pj_gc_reader.c b/src/pj_gc_reader.c
index f944b0f1..1845fca0 100644
--- a/src/pj_gc_reader.c
+++ b/src/pj_gc_reader.c
@@ -31,8 +31,9 @@
#include <projects.h>
#include <string.h>
+#include <ctype.h>
-static int pj_gc_readentry(projCtx ctx, PAFile fp, PJ_GridCatalogEntry *entry);
+static int pj_gc_readentry(projCtx ctx, PAFile fid, PJ_GridCatalogEntry *entry);
static void pj_gc_sortcatalog( projCtx ctx, PJ_GridCatalog *catalog );
/************************************************************************/
@@ -43,17 +44,17 @@ static void pj_gc_sortcatalog( projCtx ctx, PJ_GridCatalog *catalog );
PJ_GridCatalog *pj_gc_readcatalog( projCtx ctx, const char *catalog_name )
{
- PAFile fp;
+ PAFile fid;
PJ_GridCatalog *catalog;
- int entry_max, err;
+ int entry_max;
char line[302];
- fp = pj_open_lib( ctx, (char *) catalog_name, "r" );
- if (fp == NULL)
+ fid = pj_open_lib( ctx, (char *) catalog_name, "r" );
+ if (fid == NULL)
return NULL;
/* discard title line */
- fgets(line, sizeof(line)-1, fp);
+ pj_ctx_fgets(ctx, line, sizeof(line)-1, fid);
catalog = (PJ_GridCatalog *) calloc(1,sizeof(PJ_GridCatalog));
if( !catalog )
@@ -65,7 +66,7 @@ PJ_GridCatalog *pj_gc_readcatalog( projCtx ctx, const char *catalog_name )
catalog->entries = (PJ_GridCatalogEntry *)
malloc(entry_max * sizeof(PJ_GridCatalogEntry));
- while( pj_gc_readentry( ctx, fp,
+ while( pj_gc_readentry( ctx, fid,
catalog->entries+catalog->entry_count) == 0)
{
catalog->entry_count++;
@@ -105,12 +106,12 @@ static void pj_gc_sortcatalog( projCtx ctx, PJ_GridCatalog *catalog )
/* token count. */
/************************************************************************/
-static int pj_gc_read_csv_line( projCtx ctx, PAFile fp,
+static int pj_gc_read_csv_line( projCtx ctx, PAFile fid,
char **tokens, int max_tokens )
{
char line[302];
- while( fgets(line, sizeof(line)-1, fp) != NULL )
+ while( pj_ctx_fgets(ctx, line, sizeof(line)-1, fid) != NULL )
{
char *next = line;
int token_count = 0;
@@ -180,7 +181,7 @@ double pj_gc_parsedate( projCtx ctx, const char *date_string )
/* gridname,ll_long,ll_lat,ur_long,ur_lat,priority,date */
/************************************************************************/
-static int pj_gc_readentry( projCtx ctx, PAFile fp, PJ_GridCatalogEntry *entry)
+static int pj_gc_readentry(projCtx ctx, PAFile fid, PJ_GridCatalogEntry *entry)
{
#define MAX_TOKENS 30
char *tokens[MAX_TOKENS];
@@ -189,7 +190,7 @@ static int pj_gc_readentry( projCtx ctx, PAFile fp, PJ_GridCatalogEntry *entry)
memset( entry, 0, sizeof(PJ_GridCatalogEntry) );
- token_count = pj_gc_read_csv_line( ctx, fp, tokens, MAX_TOKENS );
+ token_count = pj_gc_read_csv_line( ctx, fid, tokens, MAX_TOKENS );
if( token_count < 5 )
{
error = 1; /* TODO: need real error codes */
diff --git a/src/pj_gridcatalog.c b/src/pj_gridcatalog.c
index 359e9fa0..76f52c85 100644
--- a/src/pj_gridcatalog.c
+++ b/src/pj_gridcatalog.c
@@ -119,7 +119,6 @@ int pj_gc_apply_gridshift( PJ *defn, int inverse,
{
long io = i * point_offset;
LP input, output_after, output_before;
- int itable;
double mix_ratio;
PJ_GRIDINFO *gi;