[GRASS-SVN] r50385 - grass/trunk/lib/vector/Vlib
svn_grass at osgeo.org
svn_grass at osgeo.org
Sun Jan 22 15:27:10 EST 2012
Author: mmetz
Date: 2012-01-22 12:27:10 -0800 (Sun, 22 Jan 2012)
New Revision: 50385
Modified:
grass/trunk/lib/vector/Vlib/ascii.c
Log:
G_asprintf2() changed to G_rasprintf()
Modified: grass/trunk/lib/vector/Vlib/ascii.c
===================================================================
--- grass/trunk/lib/vector/Vlib/ascii.c 2012-01-22 20:25:48 UTC (rev 50384)
+++ grass/trunk/lib/vector/Vlib/ascii.c 2012-01-22 20:27:10 UTC (rev 50385)
@@ -454,9 +454,9 @@
if (ver < 5) {
if (att != NULL) {
if (cat > 0) {
- G_asprintf2(&xstring, &xsize, "%.*f", dp, Points->x[0]);
+ G_rasprintf(&xstring, &xsize, "%.*f", dp, Points->x[0]);
G_trim_decimal(xstring);
- G_asprintf2(&ystring, &ysize, "%.*f", dp, Points->y[0]);
+ G_rasprintf(&ystring, &ysize, "%.*f", dp, Points->y[0]);
G_trim_decimal(ystring);
fprintf(att, "A %s %s %d\n", xstring, ystring, cat);
}
@@ -489,7 +489,7 @@
(window.west > Points->x[0]))
continue;
}
- G_asprintf2(&xstring, &xsize, "%.*f", dp, Points->x[0]);
+ G_rasprintf(&xstring, &xsize, "%.*f", dp, Points->x[0]);
G_trim_decimal(xstring);
if (region_flag) {
@@ -497,7 +497,7 @@
(window.south > Points->y[0]))
continue;
}
- G_asprintf2(&ystring, &ysize, "%.*f", dp, Points->y[0]);
+ G_rasprintf(&ystring, &ysize, "%.*f", dp, Points->y[0]);
G_trim_decimal(ystring);
Vect_field_cat_get(Cats, field, fcats);
@@ -532,7 +532,7 @@
(window.bottom > Points->z[0]))
continue;
}
- G_asprintf2(&zstring, &zsize, "%.*f", dp, Points->z[0]);
+ G_rasprintf(&zstring, &zsize, "%.*f", dp, Points->z[0]);
G_trim_decimal(zstring);
fprintf(ascii, "%s%s%s%s%s", xstring, fs, ystring, fs,
zstring);
@@ -605,14 +605,14 @@
while (Points->n_points--) {
- G_asprintf2(&xstring, &xsize, "%.*f", dp, *xptr++);
+ G_rasprintf(&xstring, &xsize, "%.*f", dp, *xptr++);
G_trim_decimal(xstring);
- G_asprintf2(&ystring, &ysize, "%.*f", dp, *yptr++);
+ G_rasprintf(&ystring, &ysize, "%.*f", dp, *yptr++);
G_trim_decimal(ystring);
if (ver == 5) {
if (Map->head.with_z) {
- G_asprintf2(&zstring, &zsize, "%.*f", dp, *zptr++);
+ G_rasprintf(&zstring, &zsize, "%.*f", dp, *zptr++);
G_trim_decimal(zstring);
fprintf(ascii, " %-12s %-12s %-12s\n", xstring,
ystring, zstring);
@@ -635,9 +635,9 @@
else {
if (cat > 0) {
if (ltype == GV_POINT) {
- G_asprintf2(&xstring, &xsize, "%.*f", dp, Points->x[0]);
+ G_rasprintf(&xstring, &xsize, "%.*f", dp, Points->x[0]);
G_trim_decimal(xstring);
- G_asprintf2(&ystring, &ysize, "%.*f", dp, Points->y[0]);
+ G_rasprintf(&ystring, &ysize, "%.*f", dp, Points->y[0]);
G_trim_decimal(ystring);
fprintf(att, "P %s %s %d\n", xstring, ystring, cat);
}
@@ -645,9 +645,9 @@
x = (Points->x[1] + Points->x[0]) / 2;
y = (Points->y[1] + Points->y[0]) / 2;
- G_asprintf2(&xstring, &xsize, "%.*f", dp, x);
+ G_rasprintf(&xstring, &xsize, "%.*f", dp, x);
G_trim_decimal(xstring);
- G_asprintf2(&ystring, &ysize, "%.*f", dp, y);
+ G_rasprintf(&ystring, &ysize, "%.*f", dp, y);
G_trim_decimal(ystring);
fprintf(att, "L %s %s %d\n", xstring, ystring, cat);
}
More information about the grass-commit
mailing list