[GRASS-SVN] r67277 - grass/trunk/imagery/i.cluster
svn_grass at osgeo.org
svn_grass at osgeo.org
Sun Dec 20 05:00:07 PST 2015
Author: martinl
Date: 2015-12-20 05:00:07 -0800 (Sun, 20 Dec 2015)
New Revision: 67277
Modified:
grass/trunk/imagery/i.cluster/checkpt.c
grass/trunk/imagery/i.cluster/main.c
grass/trunk/imagery/i.cluster/print1.c
grass/trunk/imagery/i.cluster/print2.c
grass/trunk/imagery/i.cluster/print4.c
Log:
i.cluster: use cross-platforn newline character for reports (rest of issues)
Modified: grass/trunk/imagery/i.cluster/checkpt.c
===================================================================
--- grass/trunk/imagery/i.cluster/checkpt.c 2015-12-20 12:51:44 UTC (rev 67276)
+++ grass/trunk/imagery/i.cluster/checkpt.c 2015-12-20 13:00:07 UTC (rev 67277)
@@ -13,7 +13,8 @@
case 1:
print_band_means(report, X);
if (insigfile) {
- fprintf(report, _("using seed means (%d files)\n"), ref.nfiles);
+ fprintf(report, _("using seed means (%d files)%s"),
+ ref.nfiles, HOST_NEWLINE);
for (c = 0; c < in_sig.nsigs; c++)
for (band = 0; band < ref.nfiles; band++)
X->mean[band][c] = in_sig.sig[c].mean[band];
@@ -25,10 +26,11 @@
print_distribution(report, X);
break;
case 3:
- fprintf(report, _("\n######## iteration %d ###########\n"),
- X->iteration);
- fprintf(report, _("%d classes, %.2f%% points stable\n"),
- I_cluster_nclasses(X, 1), (double)X->percent_stable);
+ fprintf(report, _("%s######## iteration %d ###########%s"),
+ HOST_NEWLINE, X->iteration, HOST_NEWLINE);
+ fprintf(report, _("%d classes, %.2f%% points stable%s"),
+ I_cluster_nclasses(X, 1), (double)X->percent_stable,
+ HOST_NEWLINE);
/*
I_cluster_sum2 (X);
print_class_means(report,X);
@@ -46,8 +48,8 @@
break;
case 4:
/*
- fprintf (report, _("\nmerging class %d into %d\n"),
- X->merge2+1, X->merge1+1);
+ fprintf (report, _("%smerging class %d into %d%s"),
+ HOST_NEWLINE, X->merge2+1, X->merge1+1, HOST_NEWLINE);
*/
break;
}
Modified: grass/trunk/imagery/i.cluster/main.c
===================================================================
--- grass/trunk/imagery/i.cluster/main.c 2015-12-20 12:51:44 UTC (rev 67276)
+++ grass/trunk/imagery/i.cluster/main.c 2015-12-20 13:00:07 UTC (rev 67277)
@@ -328,7 +328,8 @@
}
fprintf(report,
- _("\n\n#################### CLASSES ####################%s"), HOST_NEWLINE);
+ _("%s%s#################### CLASSES ####################%s"),
+ HOST_NEWLINE, HOST_NEWLINE, HOST_NEWLINE);
fprintf(report, _("%s%d classes, %.2f%% points stable%s"),
HOST_NEWLINE, I_cluster_nclasses(&C, 1), (double)C.percent_stable, HOST_NEWLINE);
fprintf(report, _("%s######## CLUSTER END (%s) ########%s"),
Modified: grass/trunk/imagery/i.cluster/print1.c
===================================================================
--- grass/trunk/imagery/i.cluster/print1.c 2015-12-20 12:51:44 UTC (rev 67276)
+++ grass/trunk/imagery/i.cluster/print1.c 2015-12-20 13:00:07 UTC (rev 67277)
@@ -14,7 +14,7 @@
fprintf(fd, _(" means "));
for (band = 0; band < C->nbands; band++)
fprintf(fd, " %g", C->band_sum[band] / C->npoints);
- fprintf(fd, "\n");
+ fprintf(fd, "%s", HOST_NEWLINE);
fprintf(fd, _(" stddev "));
for (band = 0; band < C->nbands; band++)
fprintf(fd, " %g",
Modified: grass/trunk/imagery/i.cluster/print2.c
===================================================================
--- grass/trunk/imagery/i.cluster/print2.c 2015-12-20 12:51:44 UTC (rev 67276)
+++ grass/trunk/imagery/i.cluster/print2.c 2015-12-20 13:00:07 UTC (rev 67277)
@@ -25,7 +25,7 @@
if (n > 0)
for (band = 0; band < C->nbands; band++)
fprintf(fd, " %g", C->sum[band][c] / n);
- fprintf(fd, "\n");
+ fprintf(fd, "%s", HOST_NEWLINE);
fprintf(fd, _(" stddev"));
if (n > 1)
for (band = 0; band < C->nbands; band++)
Modified: grass/trunk/imagery/i.cluster/print4.c
===================================================================
--- grass/trunk/imagery/i.cluster/print4.c 2015-12-20 12:51:44 UTC (rev 67276)
+++ grass/trunk/imagery/i.cluster/print4.c 2015-12-20 13:00:07 UTC (rev 67277)
@@ -22,7 +22,7 @@
(double)C->sum[band][cat] / (double)C->count[cat]);
else
sprintf(buf, FMT2, C->sum[band][cat], C->count[cat]);
- fprintf(fd, "%s %-18s", cat % 4 ? "" : "\n", buf);
+ fprintf(fd, "%s %-18s", cat % 4 ? "" : HOST_NEWLINE, buf);
}
fprintf(fd, "%s", HOST_NEWLINE);
}
More information about the grass-commit
mailing list