From 080208050d9ce18ad10ef514d17729490e00c2ae Mon Sep 17 00:00:00 2001 From: Jeff Lounsbury Date: Thu, 11 Oct 2001 17:15:50 +0000 Subject: [PATCH] Modified the .c files slightly to get rid of some warnings. git-svn-id: http://svn.osgeo.org/postgis/trunk@75 b70326c6-7e19-0410-871a-916f4a2858ee --- loader/shp2pgsql.c | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/loader/shp2pgsql.c b/loader/shp2pgsql.c index ed229f32a..6652d7487 100644 --- a/loader/shp2pgsql.c +++ b/loader/shp2pgsql.c @@ -24,6 +24,7 @@ #include "shapefil.h" #include #include +#include typedef struct {double x, y;} Point; @@ -57,9 +58,9 @@ char *make_good_string(char *str){ char *start,*end; int num_tabs = 0; - str2 = (str); + (str2) = (str); - while (str2 = strchr((str2), '\t') ) + while ((str2 = strchr(str2, '\t')) ) { if ( (str2 == str) || (str2[-1] != '\\') ) //the previous char isnt a '\' num_tabs ++; @@ -72,7 +73,7 @@ char *make_good_string(char *str){ memset(result,0, strlen(str) + num_tabs+1 ); start = str; - while(end = strchr((start),'\t')) + while((end = strchr((start),'\t'))) { if ( (end == str) || (end[-1] != '\\' ) ) //the previous char isnt a '\' { @@ -105,7 +106,7 @@ char *protect_quotes_string(char *str){ str2 = str; - while (str2 = strchr((str2), '\'') ) + while ((str2 = strchr((str2), '\'')) ) { if ( (str2 == str) || (str2[-1] != '\\') ) //the previous char isnt a '\' num_tabs ++; @@ -118,7 +119,7 @@ char *protect_quotes_string(char *str){ memset(result,0, strlen(str) + num_tabs+1 ); start = str; - while(end = strchr((start),'\'')) + while((end = strchr((start),'\''))) { if ( (end == str) || (end[-1] != '\\' ) ) //the previous char isnt a '\' { @@ -370,9 +371,11 @@ int Insert_attributes(DBFHandle hDBFHandle, int row){ for( i = 0; i < num_fields; i++ ){ if (dump_format){ - printf("\t%s",make_good_string(DBFReadStringAttribute( hDBFHandle, row, i )) ); + + printf("\t%s",make_good_string((char*)DBFReadStringAttribute( hDBFHandle,row, i )) ); }else{ - printf(",'%s'",protect_quotes_string(DBFReadStringAttribute( hDBFHandle, row, i )) ); + + printf(",'%s'",protect_quotes_string((char*)DBFReadStringAttribute(hDBFHandle, row, i )) ); } } return 1; -- 2.49.0