[GRASS-CVS] markus: grass6/lib/proj convert.c, 1.32,
1.32.2.1 get_proj.c, 1.12, 1.12.2.1
grass at intevation.de
grass at intevation.de
Sun Nov 18 15:00:41 EST 2007
Author: markus
Update of /grassrepository/grass6/lib/proj
In directory doto:/tmp/cvs-serv23299
Modified Files:
Tag: releasebranch_6_3
convert.c get_proj.c
Log Message:
Portability and warning fixes; Don't use C99 features
Index: convert.c
===================================================================
RCS file: /grassrepository/grass6/lib/proj/convert.c,v
retrieving revision 1.32
retrieving revision 1.32.2.1
diff -u -d -r1.32 -r1.32.2.1
--- convert.c 15 Jul 2007 11:14:19 -0000 1.32
+++ convert.c 18 Nov 2007 20:00:39 -0000 1.32.2.1
@@ -169,7 +169,7 @@
char *paramkey, *paramvalue;
paramkey = strtok(params, "=");
paramvalue = params + strlen(paramkey) + 1;
- if (strcasecmp(paramkey, "towgs84") == 0)
+ if (G_strcasecmp(paramkey, "towgs84") == 0)
G_asprintf(&towgs84, ",TOWGS84[%s]", paramvalue);
else
towgs84 = "";
@@ -194,7 +194,7 @@
osrunit = OSRGetAttrValue(hSRS, "UNIT", 0);
osrunfact = OSRGetAttrValue(hSRS, "UNIT", 1);
- if ((unfact == NULL) || (strcasecmp(osrunit, "unknown") != 0))
+ if ((unfact == NULL) || (G_strcasecmp(osrunit, "unknown") != 0))
end = "";
else {
double unfactf = atof(unfact);
@@ -221,7 +221,7 @@
OSRDestroySpatialReference(hSRS);
G_free(modwkt);
- G_free(wkt);
+ CPLFree(wkt);
if (proj4 != proj4mod)
G_free(proj4);
G_free(proj4mod);
@@ -416,7 +416,7 @@
list = listhead = read_datum_table();
while (list != NULL) {
- if (strcasecmp(pszDatumName, list->longname) == 0) {
+ if (G_strcasecmp(pszDatumName, list->longname) == 0) {
datum = G_store(list->name);
break;
}
@@ -608,7 +608,7 @@
dfToMeters = OSRGetLinearUnits( hSRS, &pszUnitsName );
/* Workaround for the most obvious case when unit name is unknown */
- if( (strcasecmp(pszUnitsName, "unknown") == 0) && (dfToMeters == 1.) )
+ if( (G_strcasecmp(pszUnitsName, "unknown") == 0) && (dfToMeters == 1.) )
G_asprintf( &pszUnitsName, "meter" );
G_set_key_value( "unit", pszUnitsName, *projunits );
@@ -618,13 +618,13 @@
pszUnitsPlural = G_malloc( strlen(pszUnitsName) + 3 );
strcpy(pszUnitsPlural, pszUnitsName);
pszStringEnd = pszUnitsPlural + strlen(pszUnitsPlural) - 4;
- if( strcasecmp(pszStringEnd, "foot") == 0 )
+ if( G_strcasecmp(pszStringEnd, "foot") == 0 )
{
/* Special case for foot - change two o's to e's */
pszStringEnd[1] = 'e';
pszStringEnd[2] = 'e';
}
- else if( strcasecmp(pszStringEnd, "inch") == 0 )
+ else if( G_strcasecmp(pszStringEnd, "inch") == 0 )
{
/* Special case for inch - add es */
pszStringEnd[4] = 'e';
Index: get_proj.c
===================================================================
RCS file: /grassrepository/grass6/lib/proj/get_proj.c,v
retrieving revision 1.12
retrieving revision 1.12.2.1
diff -u -d -r1.12 -r1.12.2.1
--- get_proj.c 31 Aug 2007 13:27:38 -0000 1.12
+++ get_proj.c 18 Nov 2007 20:00:39 -0000 1.12.2.1
@@ -228,8 +228,8 @@
if (!(pj = pj_init(nopt1, opt_in))) {
strcpy(buffa, _("Unable to initialise PROJ.4 with the following parameter list:"));
- char err[50];
for (i = 0; i < nopt1; i++) {
+ char err[50];
sprintf (err, " +%s", opt_in[i]);
strcat (buffa, err);
}
@@ -366,7 +366,7 @@
{
const char *gisbase = G_gisbase();
static char *buf = NULL;
- static int buf_len;
+ static size_t buf_len;
size_t len = strlen(gisbase) + sizeof(GRIDDIR) + strlen(name) + 1;
if (buf_len < len) {
More information about the grass-commit
mailing list