[GRASS-SVN] r64082 - in grass/branches/releasebranch_7_0: . vector/v.vol.rst
svn_grass at osgeo.org
svn_grass at osgeo.org
Mon Jan 12 04:36:33 PST 2015
Author: neteler
Date: 2015-01-12 04:36:33 -0800 (Mon, 12 Jan 2015)
New Revision: 64082
Modified:
grass/branches/releasebranch_7_0/
grass/branches/releasebranch_7_0/vector/v.vol.rst/dataoct.c
grass/branches/releasebranch_7_0/vector/v.vol.rst/main.c
grass/branches/releasebranch_7_0/vector/v.vol.rst/user.h
grass/branches/releasebranch_7_0/vector/v.vol.rst/user1.c
grass/branches/releasebranch_7_0/vector/v.vol.rst/user2.c
grass/branches/releasebranch_7_0/vector/v.vol.rst/user3.c
grass/branches/releasebranch_7_0/vector/v.vol.rst/user4.c
grass/branches/releasebranch_7_0/vector/v.vol.rst/vector.c
Log:
v.surf.rst/v.vol.rst: reduce messages to translate (trunk, r60669 + r60670)
Property changes on: grass/branches/releasebranch_7_0
___________________________________________________________________
Modified: svn:mergeinfo
- /grass/trunk:59626,59671,60054,60497,60563-60566,60817,60922,60976,61046,61096,61141,61994,62026,62036,62085,62105,62179-62180,62182,62190,62403,62422,62424,62428-62429,62437,62466,62469,62484,62487,62491,62494,62501,62506,62508-62509,62515,62518-62519,62521,62526,62533,62539,62541,62555,62562,62566,62570,62573,62575,62585,62588,62597,62603,62606,62608-62609,62614,62618,62628,62632,62638,62642,62648-62649,62652,62654-62657,62666,62691,62705,62709,62723,62730,62739,62741,62743,62746,62750-62752,62757,62762,62785,62798,62800-62801,62803,62805,62812,62822,62824,62828,62831,62838,62845,62847,62850,62856,62879,62881,62886,62904,62907-62908,62910,62912,62914,62916,62918,62920,62925,62932-62933,62935,62940,62942,62944-62946,62949,62955-62956,62958,62960,62962,62964,62966-62968,62970,62973,62975,62977,62981,62983,62985,62987,62989,62991,62993,62995,62997,62999-63000,63003,63005,63007,63009,63011,63013,63015,63017,63020,63022,63024,63026,63028-63031,63033,63035,63037,63040,63043-
63044,63047,63049,63051,63053,63055,63057,63060,63062-63064,63066,63068,63070-63071,63074,63076,63079,63081,63083,63085,63087,63089,63091,63093,63095,63098,63100,63102,63105,63107,63109,63111,63113-63114,63116,63119,63121,63123,63125,63130,63132-63133,63135,63137,63140,63143,63145,63147,63149,63151,63153-63154,63157,63160,63165,63170,63173,63175,63187,63192-63193,63196,63199-63200,63202,63209,63216,63220-63221,63224,63227,63240,63246,63250,63255,63259,63261,63275-63276,63279,63281,63283,63287,63290,63292,63297,63302,63304-63307,63315,63319,63327,63330,63332,63339,63342,63345,63361-63363,63367,63369,63379,63389,63391,63393,63402,63408-63409,63416-63417,63425,63427,63429,63431,63433,63448,63451,63453,63457,63459,63461,63464-63470,63473,63482,63497,63505,63508,63510,63515,63521-63524,63526,63528,63536-63537,63551-63552,63554,63556,63558-63559,63562,63570,63576,63582,63589-63593,63602,63604,63608-63610,63616,63618,63624,63626,63628,63630,63634,63639,63642,63644,63650,63652,63656
,63679,63685,63689,63691,63693,63695,63698,63700-63702,63704,63706-63707,63709,63711,63713,63715,63717-63718,63721-63727,63731,63733,63736,63740-63742,63744-63749,63751-63752,63756,63758,63760-63761,63767,63777,63780,63783,63787,63793,63796-63798,63801,63803,63807-63808,63812,63814,63816,63821,63823-63824,63827-63828,63830-63831,63834-63835,63837-63839,63841,63843-63844,63846-63847,63849,63851,63853,63855-63856,63858-63859,63862,63865,63869,63871,63882,63884,63889-63890,63892-63895,63897-63898,63900,63902-63903,63905,63907,63909-63911,63913-63914,63927,63930-63931,63940-63941,63945,63954-63955,63960,63965,63967,63976-63983,63995,64026,64030,64040,64056,64062
+ /grass/trunk:59626,59671,60054,60497,60563-60566,60670,60817,60922,60976,61046,61096,61141,61994,62026,62036,62085,62105,62179-62180,62182,62190,62403,62422,62424,62428-62429,62437,62466,62469,62484,62487,62491,62494,62501,62506,62508-62509,62515,62518-62519,62521,62526,62533,62539,62541,62555,62562,62566,62570,62573,62575,62585,62588,62597,62603,62606,62608-62609,62614,62618,62628,62632,62638,62642,62648-62649,62652,62654-62657,62666,62691,62705,62709,62723,62730,62739,62741,62743,62746,62750-62752,62757,62762,62785,62798,62800-62801,62803,62805,62812,62822,62824,62828,62831,62838,62845,62847,62850,62856,62879,62881,62886,62904,62907-62908,62910,62912,62914,62916,62918,62920,62925,62932-62933,62935,62940,62942,62944-62946,62949,62955-62956,62958,62960,62962,62964,62966-62968,62970,62973,62975,62977,62981,62983,62985,62987,62989,62991,62993,62995,62997,62999-63000,63003,63005,63007,63009,63011,63013,63015,63017,63020,63022,63024,63026,63028-63031,63033,63035,63037,63040,
63043-63044,63047,63049,63051,63053,63055,63057,63060,63062-63064,63066,63068,63070-63071,63074,63076,63079,63081,63083,63085,63087,63089,63091,63093,63095,63098,63100,63102,63105,63107,63109,63111,63113-63114,63116,63119,63121,63123,63125,63130,63132-63133,63135,63137,63140,63143,63145,63147,63149,63151,63153-63154,63157,63160,63165,63170,63173,63175,63187,63192-63193,63196,63199-63200,63202,63209,63216,63220-63221,63224,63227,63240,63246,63250,63255,63259,63261,63275-63276,63279,63281,63283,63287,63290,63292,63297,63302,63304-63307,63315,63319,63327,63330,63332,63339,63342,63345,63361-63363,63367,63369,63379,63389,63391,63393,63402,63408-63409,63416-63417,63425,63427,63429,63431,63433,63448,63451,63453,63457,63459,63461,63464-63470,63473,63482,63497,63505,63508,63510,63515,63521-63524,63526,63528,63536-63537,63551-63552,63554,63556,63558-63559,63562,63570,63576,63582,63589-63593,63602,63604,63608-63610,63616,63618,63624,63626,63628,63630,63634,63639,63642,63644,63650,63652
,63656,63679,63685,63689,63691,63693,63695,63698,63700-63702,63704,63706-63707,63709,63711,63713,63715,63717-63718,63721-63727,63731,63733,63736,63740-63742,63744-63749,63751-63752,63756,63758,63760-63761,63767,63777,63780,63783,63787,63793,63796-63798,63801,63803,63807-63808,63812,63814,63816,63821,63823-63824,63827-63828,63830-63831,63834-63835,63837-63839,63841,63843-63844,63846-63847,63849,63851,63853,63855-63856,63858-63859,63862,63865,63869,63871,63882,63884,63889-63890,63892-63895,63897-63898,63900,63902-63903,63905,63907,63909-63911,63913-63914,63927,63930-63931,63940-63941,63945,63954-63955,63960,63965,63967,63976-63983,63995,64026,64030,64040,64056,64062
Modified: grass/branches/releasebranch_7_0/vector/v.vol.rst/dataoct.c
===================================================================
--- grass/branches/releasebranch_7_0/vector/v.vol.rst/dataoct.c 2015-01-12 12:25:46 UTC (rev 64081)
+++ grass/branches/releasebranch_7_0/vector/v.vol.rst/dataoct.c 2015-01-12 12:36:33 UTC (rev 64082)
@@ -29,6 +29,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <grass/gis.h>
+#include <grass/glocale.h>
#include "dataoct.h"
#include "externs.h"
#include "user.h"
@@ -191,8 +192,8 @@
double dx, dy, dz, x_or, y_or, z_or;
if ((data->n_cols <= 1) || (data->n_rows <= 1)) {
- clean_fatal_error
- ("Points are too concentrated -- please increase DMIN");
+ clean();
+ G_fatal_error(_("Points are too concentrated -- please increase DMIN"));
}
if (data->n_cols % 2 == 0) {
@@ -240,7 +241,8 @@
for (i = 0; i < data->n_points; i++) {
comp = oct_compare(data->points + i, data);
if ((comp < 1) || (comp > NUMLEAFS)) {
- clean_fatal_error("Point out of range");
+ clean();
+ G_fatal_error(_("Point out of range"));
}
oct_add_data(data->points + i, datas[comp]);
}
Modified: grass/branches/releasebranch_7_0/vector/v.vol.rst/main.c
===================================================================
--- grass/branches/releasebranch_7_0/vector/v.vol.rst/main.c 2015-01-12 12:25:46 UTC (rev 64081)
+++ grass/branches/releasebranch_7_0/vector/v.vol.rst/main.c 2015-01-12 12:36:33 UTC (rev 64082)
@@ -68,8 +68,6 @@
int cv;
int sig1;
-char msg[80];
-
struct Map_info Map;
dbString sql;
dbDriver *driver;
@@ -490,8 +488,8 @@
(cellinp != NULL || outz != NULL || cellout != NULL ||
gradient != NULL || aspect1 != NULL || aspect2 != NULL ||
ncurv != NULL || gcurv != NULL || mcurv != NULL || devi != NULL))
- G_fatal_error("Crossvalidation cannot be computed simultanuously "
- "with output grids or devi file");
+ G_fatal_error(_("Crossvalidation cannot be computed simultanuously "
+ "with output grids or devi file"));
z_orig_in = z_orig;
tb_res_in = tb_res;
@@ -506,46 +504,46 @@
/*************** KMAX2 = GRADPARAM1*npmax;***************/
az = (double *)G_malloc(sizeof(double) * (n_cols + 1));
if (!az)
- G_fatal_error("Not enough memory for az");
+ G_fatal_error(_("Not enough memory for %s"), "az");
adx = (double *)G_malloc(sizeof(double) * (n_cols + 1));
if (!adx)
- G_fatal_error("Not enough memory for adx");
+ G_fatal_error(_("Not enough memory for %s"), "adx");
ady = (double *)G_malloc(sizeof(double) * (n_cols + 1));
if (!ady)
- G_fatal_error("Not enough memory for ady");
+ G_fatal_error(_("Not enough memory for %s"), "ady");
adxx = (double *)G_malloc(sizeof(double) * (n_cols + 1));
if (!adxx)
- G_fatal_error("Not enough memory for adxx");
+ G_fatal_error(_("Not enough memory for %s"), "adxx");
adyy = (double *)G_malloc(sizeof(double) * (n_cols + 1));
if (!adyy)
- G_fatal_error("Not enough memory for adyy");
+ G_fatal_error(_("Not enough memory for %s"), "adyy");
adxy = (double *)G_malloc(sizeof(double) * (n_cols + 1));
if (!adxy)
- G_fatal_error("Not enough memory for adxy");
+ G_fatal_error(_("Not enough memory for %s"), "adxy");
adz = (double *)G_malloc(sizeof(double) * (n_cols + 1));
if (!adz)
- G_fatal_error("Not enough memory for adz");
+ G_fatal_error(_("Not enough memory for %s"), "adz");
adxz = (double *)G_malloc(sizeof(double) * (n_cols + 1));
if (!adxz)
- G_fatal_error("Not enough memory for adxz");
+ G_fatal_error(_("Not enough memory for %s"), "adxz");
adyz = (double *)G_malloc(sizeof(double) * (n_cols + 1));
if (!adyz)
- G_fatal_error("Not enough memory for adyz");
+ G_fatal_error(_("Not enough memory for %s"), "adyz");
adzz = (double *)G_malloc(sizeof(double) * (n_cols + 1));
if (!adzz)
- G_fatal_error("Not enough memory for adzz");
+ G_fatal_error(_("Not enough memory for %s"), "adzz");
if ((data =
data_new(x_orig, y_orig, z_orig, n_rows, n_cols, n_levs, 0)) == NULL)
- G_fatal_error("Unable to create octdata");
+ G_fatal_error(_("Unable to create %s"), "octdata");
if ((functions =
OT_functions_new(oct_compare, oct_divide_data, oct_add_data,
oct_intersect, oct_division_check,
oct_get_points)) == NULL)
- G_fatal_error("Unable to create octfunc");
+ G_fatal_error(_("Unable to create %s"), "octfunc");
if ((tree = OT_tree_new(data, NULL, NULL, functions, 0)) == NULL)
- G_fatal_error("Unable to create octtree");
+ G_fatal_error(_("Unable to create %s"), "octtree");
root = tree;
@@ -554,7 +552,7 @@
*/
if (TESTOUT) {
if ((fd4 = fopen("testout", "w+")) == NULL)
- G_fatal_error("Unable to open testout");
+ G_fatal_error(_("Unable to open %s"), "testout");
}
Vect_set_open_level(1);
@@ -604,7 +602,7 @@
db_set_error_handler_driver(driver);
if (db_execute_immediate(driver, &sql) != DB_OK) {
- G_fatal_error(_("Unable To create table: %s"), db_get_string(&sql));
+ G_fatal_error(_("Unable to create table '%s'"), db_get_string(&sql));
}
count = 1;
}
@@ -618,24 +616,28 @@
fdcell = Rast_open_old(cellinp, mapset);
fdcout = Rast_open_fp_new(cellout);
zero_array_cell = (FCELL *) G_malloc(sizeof(FCELL) * n_cols);
- if (!zero_array_cell)
- clean_fatal_error("Not enough memory for zero_array_cell\n");
+ if (!zero_array_cell) {
+ clean();
+ G_fatal_error(_("Not enough memory for %s"), "zero_array_cell");
+ }
for (i = 0; i < n_cols; i++)
zero_array_cell[i] = 0;
Tmp_file_cell = G_tempfile();
if (NULL == (Tmp_fd_cell = fopen(Tmp_file_cell, "w+"))) {
- sprintf(msg, "Can't open temp file [%s] ", Tmp_file_cell);
- clean_fatal_error(msg);
+ clean();
+ G_fatal_error(_("Unable to open temp file '%s'"), Tmp_file_cell);
}
/* filling temp file with zeroes */
for (i = 0; i < n_rows; i++) {
if (!
(fwrite
- (zero_array_cell, sizeof(FCELL), n_cols, Tmp_fd_cell)))
- clean_fatal_error(_("Not enough disk space - cannot write temp files"));
+ (zero_array_cell, sizeof(FCELL), n_cols, Tmp_fd_cell))) {
+ clean();
+ G_fatal_error(_("Not enough disk space - cannot write temp files"));
+ }
}
} else
- G_warning("Unable to create cellout raster map without cellinp");
+ G_warning(_("Unable to create cellout raster map without cellinp"));
ertot = 0.;
out_cond1 = (outz != NULL) || (gradient != NULL) || (aspect1 != NULL)
@@ -645,127 +647,155 @@
if (outz != NULL) {
/* allocating temp array for writing to corresponding temp file */
zero_array1 = (float *)G_malloc(sizeof(float) * n_cols);
- if (!zero_array1)
- clean_fatal_error(_("Not enough memory"));
+ if (!zero_array1) {
+ clean();
+ G_fatal_error(_("Not enough memory for %s"), "zero_array1");
+ }
for (i = 0; i < n_cols; i++)
zero_array1[i] = 0.;
Tmp_file_z = G_tempfile();
if (NULL == (Tmp_fd_z = fopen(Tmp_file_z, "w+"))) {
- sprintf(msg, _("Unable to open temp file '%s'"), Tmp_file_z);
- clean_fatal_error(msg);
+ clean();
+ G_fatal_error(_("Unable to open temp file '%s'"), Tmp_file_z);
}
/* filling temp file with zeroes */
for (i = 0; i < n_levs * n_rows; i++) {
- if (!(fwrite(zero_array1, sizeof(float), n_cols, Tmp_fd_z)))
- clean_fatal_error(_("Not enough disk space - cannot write temp files"));
+ if (!(fwrite(zero_array1, sizeof(float), n_cols, Tmp_fd_z))) {
+ clean();
+ G_fatal_error(_("Not enough disk space - cannot write temp files"));
+ }
}
}
if (gradient != NULL) {
/* allocating temp array for writing to corresponding temp file */
zero_array2 = (float *)G_malloc(sizeof(float) * n_cols);
- if (!zero_array2)
- clean_fatal_error(_("Not enough memory"));
+ if (!zero_array2) {
+ clean();
+ G_fatal_error(_("Not enough memory for %s"), "zero_array2");
+ }
for (i = 0; i < n_cols; i++)
zero_array2[i] = 0.;
Tmp_file_dx = G_tempfile();
if (NULL == (Tmp_fd_dx = fopen(Tmp_file_dx, "w+"))) {
- sprintf(msg, _("Unable to open temp file '%s'"), Tmp_file_dx);
- clean_fatal_error(msg);
+ clean();
+ G_fatal_error(_("Unable to open temp file '%s'"), Tmp_file_dx);
}
/* filling temp file with zeroes */
for (i = 0; i < n_levs * n_rows; i++) {
- if (!(fwrite(zero_array2, sizeof(float), n_cols, Tmp_fd_dx)))
- clean_fatal_error(_("Not enough disk space - cannot write temp files"));
+ if (!(fwrite(zero_array2, sizeof(float), n_cols, Tmp_fd_dx))) {
+ clean();
+ G_fatal_error(_("Not enough disk space - cannot write temp files"));
+ }
}
}
if (aspect1 != NULL) {
/* allocating temp array for writing to corresponding temp file */
zero_array3 = (float *)G_malloc(sizeof(float) * n_cols);
- if (!zero_array3)
- clean_fatal_error(_("Not enough memory"));
+ if (!zero_array3) {
+ clean();
+ G_fatal_error(_("Not enough memory for %s"), "zero_array3");
+ }
for (i = 0; i < n_cols; i++)
zero_array3[i] = 0.;
Tmp_file_dy = G_tempfile();
if (NULL == (Tmp_fd_dy = fopen(Tmp_file_dy, "w+"))) {
- sprintf(msg, _("Unable to open temp file '%s'"), Tmp_file_dy);
- clean_fatal_error(msg);
+ clean();
+ G_fatal_error(_("Unable to open temp file '%s'"), Tmp_file_dy);
}
/* filling temp file with zeroes */
for (i = 0; i < n_levs * n_rows; i++) {
- if (!(fwrite(zero_array3, sizeof(float), n_cols, Tmp_fd_dy)))
- clean_fatal_error(_("Not enough disk space - cannot write temp files"));
+ if (!(fwrite(zero_array3, sizeof(float), n_cols, Tmp_fd_dy))) {
+ clean();
+ G_fatal_error(_("Not enough disk space - cannot write temp files"));
+ }
}
}
if (aspect2 != NULL) {
/* allocating temp array for writing to corresponding temp file */
zero_array4 = (float *)G_malloc(sizeof(float) * n_cols);
- if (!zero_array4)
- clean_fatal_error(_("Not enough memory"));
+ if (!zero_array4) {
+ clean();
+ G_fatal_error(_("Not enough memory for %s"), "zero_array4");
+ }
for (i = 0; i < n_cols; i++)
zero_array4[i] = 0.;
Tmp_file_dz = G_tempfile();
if (NULL == (Tmp_fd_dz = fopen(Tmp_file_dz, "w+"))) {
- sprintf(msg, _("Unable to open temp file '%s'"), Tmp_file_dz);
- clean_fatal_error(msg);
+ clean();
+ G_fatal_error(_("Unable to open temp file '%s'"), Tmp_file_dz);
}
/* filling temp file with zeroes */
for (i = 0; i < n_levs * n_rows; i++) {
- if (!(fwrite(zero_array4, sizeof(float), n_cols, Tmp_fd_dz)))
- clean_fatal_error(_("Not enough disk space - cannot write temp files"));
+ if (!(fwrite(zero_array4, sizeof(float), n_cols, Tmp_fd_dz))) {
+ clean();
+ G_fatal_error(_("Not enough disk space - cannot write temp files"));
+ }
}
}
if (ncurv != NULL) {
/* allocating temp array for writing to corresponding temp file */
zero_array5 = (float *)G_malloc(sizeof(float) * n_cols);
- if (!zero_array5)
- clean_fatal_error(_("Not enough memory"));
+ if (!zero_array5) {
+ clean();
+ G_fatal_error(_("Not enough memory for %s"), "zero_array5");
+ }
for (i = 0; i < n_cols; i++)
zero_array5[i] = 0.;
Tmp_file_xx = G_tempfile();
if (NULL == (Tmp_fd_xx = fopen(Tmp_file_xx, "w+"))) {
- sprintf(msg, _("Unable to open temp file '%s'"), Tmp_file_xx);
- clean_fatal_error(msg);
+ clean();
+ G_fatal_error(_("Unable to open temp file '%s'"), Tmp_file_xx);
}
/* filling temp file with zeroes */
for (i = 0; i < n_levs * n_rows; i++) {
- if (!(fwrite(zero_array5, sizeof(float), n_cols, Tmp_fd_xx)))
- clean_fatal_error(_("Not enough disk space - cannot write temp files"));
+ if (!(fwrite(zero_array5, sizeof(float), n_cols, Tmp_fd_xx))) {
+ clean();
+ G_fatal_error(_("Not enough disk space - cannot write temp files"));
+ }
}
}
if (gcurv != NULL) {
/* allocating temp array for writing to corresponding temp file */
zero_array6 = (float *)G_malloc(sizeof(float) * n_cols);
- if (!zero_array6)
- clean_fatal_error(_("Not enough memory"));
+ if (!zero_array6) {
+ clean();
+ G_fatal_error(_("Not enough memory for %s"), "zero_array6");
+ }
for (i = 0; i < n_cols; i++)
zero_array6[i] = 0.;
Tmp_file_yy = G_tempfile();
if (NULL == (Tmp_fd_yy = fopen(Tmp_file_yy, "w+"))) {
- sprintf(msg, _("Unable to open temp file '%s'"), Tmp_file_yy);
- clean_fatal_error(msg);
+ clean();
+ G_fatal_error(_("Unable to open temp file '%s'"), Tmp_file_yy);
}
/* filling temp file with zeroes */
for (i = 0; i < n_levs * n_rows; i++) {
- if (!(fwrite(zero_array6, sizeof(float), n_cols, Tmp_fd_yy)))
- clean_fatal_error(_("Not enough disk space - cannot write temp files"));
+ if (!(fwrite(zero_array6, sizeof(float), n_cols, Tmp_fd_yy))) {
+ clean();
+ G_fatal_error(_("Not enough disk space - cannot write temp files"));
+ }
}
}
if (mcurv != NULL) {
/* allocating temp array for writing to corresponding temp file */
zero_array7 = (float *)G_malloc(sizeof(float) * n_cols);
- if (!zero_array7)
- clean_fatal_error(_("Not enough memory"));
+ if (!zero_array7) {
+ clean();
+ G_fatal_error(_("Not enough memory for %s"), "zero_array7");
+ }
for (i = 0; i < n_cols; i++)
zero_array7[i] = 0.;
Tmp_file_xy = G_tempfile();
if (NULL == (Tmp_fd_xy = fopen(Tmp_file_xy, "w+"))) {
- sprintf(msg, _("Unable to open temp file '%s'"), Tmp_file_xy);
- clean_fatal_error(msg);
+ clean();
+ G_fatal_error(_("Unable to open temp file '%s'"), Tmp_file_xy);
}
/* filling temp file with zeroes */
for (i = 0; i < n_levs * n_rows; i++) {
- if (!(fwrite(zero_array7, sizeof(float), n_cols, Tmp_fd_xy)))
- clean_fatal_error(_("Not enough disk space - cannot write temp files"));
+ if (!(fwrite(zero_array7, sizeof(float), n_cols, Tmp_fd_xy))) {
+ clean();
+ G_fatal_error(_("Not enough disk space - cannot write temp files"));
+ }
}
}
cursegm = 0;
@@ -785,7 +815,7 @@
if (mcurv != NULL)
G_free(zero_array7);
- G_message("Finished interpolating");
+ G_message(_("Finished interpolating"));
if (fd4 != NULL)
fprintf(fd4, "max. error found = %f \n", ertot);
G_free(root);
@@ -874,11 +904,15 @@
NPOINT);
}
- else
- clean_fatal_error(_("Interpolation failed"));
+ else {
+ clean();
+ G_fatal_error(_("Interpolation failed"));
+ }
}
- else
- clean_fatal_error(_("Input failed"));
+ else {
+ clean();
+ G_fatal_error(_("Input failed"));
+ }
if (fd4 != NULL)
fclose(fd4);
Modified: grass/branches/releasebranch_7_0/vector/v.vol.rst/user.h
===================================================================
--- grass/branches/releasebranch_7_0/vector/v.vol.rst/user.h 2015-01-12 12:25:46 UTC (rev 64081)
+++ grass/branches/releasebranch_7_0/vector/v.vol.rst/user.h 2015-01-12 12:36:33 UTC (rev 64082)
@@ -18,7 +18,7 @@
int COGRR1();
int POINT();
int LINEQS();
-void clean_fatal_error(const char*);
+void clean();
int point_save();
#endif
Modified: grass/branches/releasebranch_7_0/vector/v.vol.rst/user1.c
===================================================================
--- grass/branches/releasebranch_7_0/vector/v.vol.rst/user1.c 2015-01-12 12:25:46 UTC (rev 64081)
+++ grass/branches/releasebranch_7_0/vector/v.vol.rst/user1.c 2015-01-12 12:36:33 UTC (rev 64082)
@@ -109,7 +109,7 @@
G_fatal_error(_("Column type of wcolumn is not supported (must be integer or double)"));
if (nrec < 0)
- G_fatal_error("Unable to select data from table");
+ G_fatal_error(_("Unable to select data from table"));
G_message("%d records selected from table", nrec);
if (scol != NULL) {
@@ -120,10 +120,10 @@
sctype = cvarr.ctype;
if (sctype == -1)
- G_fatal_error("Cannot read column type of smooth column");
+ G_fatal_error(_("Cannot read column type of smooth column"));
if (sctype == DB_C_TYPE_DATETIME)
G_fatal_error
- ("Column type of smooth column (datetime) is not supported");
+ (_("Column type of smooth column (datetime) is not supported"));
if (sctype != DB_C_TYPE_INT && sctype != DB_C_TYPE_DOUBLE)
G_fatal_error(_("Column type of smooth column is not supported (must be integer or double)"));
}
@@ -137,7 +137,7 @@
int ival, type, ret;
if (-1 == (type = Vect_read_next_line(In, Points, Cats)))
- G_fatal_error("Unable to read vector map");
+ G_fatal_error(_("Unable to read vector map"));
if (type == -2)
break; /* EOF */
@@ -147,7 +147,7 @@
Vect_cat_get(Cats, 1, &cat);
if (cat < 0) {
- G_warning("Point without category");
+ G_warning(_("Point without category"));
continue;
}
@@ -205,13 +205,14 @@
((c1 >= 0) && (c2 >= 0) && (c3 >= 0) && (c4 >= 0) && (c5 >= 0) &&
(c6 >= 0))) {
if (!OUTRANGE) {
- G_warning("some points outside of region -- will ignore...");
+ G_warning(_("Some points outside of region -- will ignore..."));
}
OUTRANGE++;
}
else {
if (!(point = point_new(x, y, z, w, sm))) {
- clean_fatal_error("Cannot allocate memory for point");
+ clean();
+ G_fatal_error(_("Cannot allocate memory for point"));
}
a = OT_insert_oct(point, root);
@@ -219,7 +220,7 @@
NPOINT++;
}
if (a < 0) {
- G_warning("Can't insert %lf,%lf,%lf,%lf,%lf a=%d\n", x, y, z,
+ G_warning(_("Can't insert %lf,%lf,%lf,%lf,%lf a=%d"), x, y, z,
w, sm, a);
return -1;
}
@@ -266,7 +267,7 @@
if (!once) {
once = 1;
- G_warning("strip exists with insufficient data");
+ G_warning(_("Strip exists with insufficient data"));
}
}
@@ -274,8 +275,10 @@
totsegm = translate_oct(root, ((struct octdata *)(root->data))->x_orig,
((struct octdata *)(root->data))->y_orig,
((struct octdata *)(root->data))->z_orig, nz);
- if (!totsegm)
- clean_fatal_error("Zero segments!");
+ if (!totsegm) {
+ clean();
+ G_fatal_error(_("Zero segments!"));
+ }
((struct octdata *)(root->data))->x_orig = 0;
((struct octdata *)(root->data))->y_orig = 0;
@@ -305,17 +308,17 @@
fprintf(stderr, "\n");
if (OUTRANGE > 0)
G_warning
- ("There are points outside specified 2D/3D region--ignored %d points (total points: %d)",
+ (_("There are points outside specified 2D/3D region--ignored %d points (total points: %d)"),
OUTRANGE, k);
if (NPOINT > 0)
G_warning
- ("Points are more dense than specified 'DMIN'--ignored %d points (remain %d)",
+ (_("Points are more dense than specified 'DMIN'--ignored %d points (remain %d)"),
NPOINT, k - NPOINT);
NPOINT = k - NPOINT - NPT - OUTRANGE;
if (NPOINT < KMIN) {
if (NPOINT != 0) {
G_warning
- ("%d points given for interpolation (after thinning) is less than given NPMIN=%d",
+ (_("%d points given for interpolation (after thinning) is less than given NPMIN=%d"),
NPOINT, KMIN);
KMIN = NPOINT;
}
@@ -335,7 +338,7 @@
if (NPOINT < KMAXPOINTS && KMAX != KMAXPOINTS)
G_warning
- ("There is less than %d points for interpolation, no segmentation is necessary, to run the program faster, set segmax=%d (see manual)",
+ (_("There is less than %d points for interpolation, no segmentation is necessary, to run the program faster, set segmax=%d (see manual)"),
KMAXPOINTS, KMAXPOINTS);
deltx = xmax - xmin;
@@ -361,8 +364,8 @@
if (maskmap != NULL) {
mapsetm = G_find_raster2(maskmap, "");
if (!mapsetm) {
- sprintf(buf, "mask raster map [%s] not found\n", maskmap);
- clean_fatal_error(buf);
+ clean();
+ G_fatal_error(_("Mask raster map [%s] not found"), maskmap);
}
bitmask = BM_create(nsizc, nsizr);
cellmask = Rast_allocate_c_buf();
@@ -377,7 +380,7 @@
BM_set(bitmask, j, irev, 1);
}
}
- G_message("bitmap mask created");
+ G_message(_("Bitmap mask created"));
}
return 1;
@@ -394,7 +397,6 @@
FCELL *cell;
float *data;
int i, iarc, cnt;
- char buff[1024];
int bmask = 1;
int x, y;
float value;
@@ -417,7 +419,8 @@
current_region.top = nsizl * tb_res_in + z_orig_in;
if (!(data = (float *)G_malloc(sizeof(float) * nsizr * nsizc * nsizl))) {
- clean_fatal_error("Error: out of memory");
+ clean();
+ G_fatal_error(_("Out of memory"));
}
/*** Write elevation results ***/
@@ -425,8 +428,8 @@
cf1 = Rast3d_open_new_opt_tile_size(outz, RASTER3D_USE_CACHE_DEFAULT, ¤t_region, FCELL_TYPE, 32);
if (cf1 == NULL) {
- sprintf(buff, "Can't open %s for writing ", outz);
- clean_fatal_error(buff);
+ clean();
+ G_fatal_error(_("Unable to open %s for writing"), outz);
}
/* seek to the beginning */
@@ -435,8 +438,10 @@
/* Read data in from temp file */
read_val =
fread(data, sizeof(float), nsizr * nsizc * nsizl, Tmp_fd_z);
- if (read_val < 0)
- clean_fatal_error("Cannot read data from temp file");
+ if (read_val < 0) {
+ clean();
+ G_fatal_error(_("Unable to read data from temp file"));
+ }
cnt = 0;
for (iarc = 0; iarc < nsizl; iarc++) {
@@ -451,10 +456,10 @@
if (!bmask)
Rast3d_set_null_value(&value, 1, FCELL_TYPE);
if (Rast3d_put_float(cf1, x, y, iarc, value) == 0) {
- sprintf(buff,
- "Error writing cell (%d,%d,%d) with value %f",
+ clean();
+ G_fatal_error(
+ _("Error writing cell (%d,%d,%d) with value %f"),
x, y, iarc, value);
- clean_fatal_error(buff);
}
cnt++;
@@ -465,8 +470,8 @@
/* Close the file */
if (Rast3d_close(cf1) == 0) {
- sprintf(buff, "Error closing output file %s ", outz);
- clean_fatal_error(buff);
+ clean();
+ G_fatal_error(_("Error closing output file %s"), outz);
} else
G_message(_("3D raster map <%s> created"), outz);
}
@@ -476,8 +481,8 @@
cf2 = Rast3d_open_new_opt_tile_size(gradient, RASTER3D_USE_CACHE_DEFAULT, ¤t_region, FCELL_TYPE, 32);
if (cf2 == NULL) {
- sprintf(buff, "Can't open %s for writing ", gradient);
- clean_fatal_error(buff);
+ clean();
+ G_fatal_error(_("Unable to open %s for writing"), gradient);
}
/* seek to the beginning */
@@ -486,8 +491,10 @@
/* Read data in from temp file */
read_val =
fread(data, sizeof(float), nsizr * nsizc * nsizl, Tmp_fd_dx);
- if (read_val < 0)
- clean_fatal_error("Cannot read data from temp file");
+ if (read_val < 0) {
+ clean();
+ G_fatal_error(_("Unable to read data from temp file"));
+ }
cnt = 0;
for (iarc = 0; iarc < nsizl; iarc++) {
@@ -502,10 +509,10 @@
if (!bmask)
Rast3d_set_null_value(&value, 1, FCELL_TYPE);
if (Rast3d_put_float(cf2, x, y, iarc, value) == 0) {
- sprintf(buff,
- "Error writing cell (%d,%d,%d) with value %f",
+ clean();
+ G_fatal_error(
+ _("Error writing cell (%d,%d,%d) with value %f"),
x, y, iarc, value);
- clean_fatal_error(buff);
}
cnt++;
@@ -516,8 +523,8 @@
/* Close the file */
if (Rast3d_close(cf2) == 0) {
- sprintf(buff, "Error closing output file %s ", gradient);
- clean_fatal_error(buff);
+ clean();
+ G_fatal_error(_("Error closing output file %s"), gradient);
} else
G_message(_("3D raster map <%s> created"), gradient);
}
@@ -527,8 +534,8 @@
cf3 = Rast3d_open_new_opt_tile_size(aspect1, RASTER3D_USE_CACHE_DEFAULT, ¤t_region, FCELL_TYPE, 32);
if (cf3 == NULL) {
- sprintf(buff, "Can't open %s for writing ", aspect1);
- clean_fatal_error(buff);
+ clean();
+ G_fatal_error(_("Unable to open %s for writing"), aspect1);
}
/* seek to the beginning */
@@ -537,8 +544,10 @@
/* Read data in from temp file */
read_val =
fread(data, sizeof(float), nsizr * nsizc * nsizl, Tmp_fd_dy);
- if (read_val < 0)
- clean_fatal_error("Cannot read data from temp file");
+ if (read_val < 0) {
+ clean();
+ G_fatal_error(_("Unable to read data from temp file"));
+ }
cnt = 0;
for (iarc = 0; iarc < nsizl; iarc++) {
@@ -553,10 +562,10 @@
if (!bmask)
Rast3d_set_null_value(&value, 1, FCELL_TYPE);
if (Rast3d_put_float(cf3, x, y, iarc, value) == 0) {
- sprintf(buff,
- "Error writing cell (%d,%d,%d) with value %f",
+ clean();
+ G_fatal_error(
+ _("Error writing cell (%d,%d,%d) with value %f"),
x, y, iarc, value);
- clean_fatal_error(buff);
}
cnt++;
@@ -567,8 +576,8 @@
/* Close the file */
if (Rast3d_close(cf3) == 0) {
- sprintf(buff, "Error closing output file %s ", aspect1);
- clean_fatal_error(buff);
+ clean();
+ G_fatal_error(_("Error closing output file %s"), aspect1);
} else
G_message(_("3D raster map <%s> created"), aspect1);
}
@@ -578,8 +587,8 @@
cf4 = Rast3d_open_new_opt_tile_size(aspect2, RASTER3D_USE_CACHE_DEFAULT, ¤t_region, FCELL_TYPE, 32);
if (cf4 == NULL) {
- sprintf(buff, "Can't open %s for writing ", aspect2);
- clean_fatal_error(buff);
+ clean();
+ G_fatal_error(_("Unable to open %s for writing"), aspect2);
}
/* seek to the beginning */
@@ -588,8 +597,10 @@
/* Read data in from temp file */
read_val =
fread(data, sizeof(float), nsizr * nsizc * nsizl, Tmp_fd_dz);
- if (read_val < 0)
- clean_fatal_error("Cannot read data from temp file");
+ if (read_val < 0) {
+ clean();
+ G_fatal_error(_("Unable to read data from temp file"));
+ }
cnt = 0;
for (iarc = 0; iarc < nsizl; iarc++) {
@@ -604,10 +615,10 @@
if (!bmask)
Rast3d_set_null_value(&value, 1, FCELL_TYPE);
if (Rast3d_put_float(cf4, x, y, iarc, value) == 0) {
- sprintf(buff,
- "Error writing cell (%d,%d,%d) with value %f",
+ clean();
+ G_fatal_error(
+ _("Error writing cell (%d,%d,%d) with value %f"),
x, y, iarc, value);
- clean_fatal_error(buff);
}
cnt++;
@@ -618,8 +629,8 @@
/* Close the file */
if (Rast3d_close(cf4) == 0) {
- sprintf(buff, "Error closing output file %s ", aspect2);
- clean_fatal_error(buff);
+ clean();
+ G_fatal_error(_("Error closing output file %s"), aspect2);
} else
G_message(_("3D raster map <%s> created"), aspect2);
}
@@ -629,8 +640,8 @@
cf5 = Rast3d_open_new_opt_tile_size(ncurv, RASTER3D_USE_CACHE_DEFAULT, ¤t_region, FCELL_TYPE, 32);
if (cf5 == NULL) {
- sprintf(buff, "Can't open %s for writing ", ncurv);
- clean_fatal_error(buff);
+ clean();
+ G_fatal_error(_("Unable to open %s for writing"), ncurv);
}
/* seek to the beginning */
@@ -639,8 +650,10 @@
/* Read data in from temp file */
read_val =
fread(data, sizeof(float), nsizr * nsizc * nsizl, Tmp_fd_xx);
- if (read_val < 0)
- clean_fatal_error("Cannot read data from temp file");
+ if (read_val < 0) {
+ clean();
+ G_fatal_error(_("Unable to read data from temp file"));
+ }
cnt = 0;
for (iarc = 0; iarc < nsizl; iarc++) {
@@ -655,10 +668,10 @@
if (!bmask)
Rast3d_set_null_value(&value, 1, FCELL_TYPE);
if (Rast3d_put_float(cf5, x, y, iarc, value) == 0) {
- sprintf(buff,
- "Error writing cell (%d,%d,%d) with value %f",
+ clean();
+ G_fatal_error(
+ _("Error writing cell (%d,%d,%d) with value %f"),
x, y, iarc, value);
- clean_fatal_error(buff);
}
cnt++;
@@ -669,8 +682,8 @@
/* Close the file */
if (Rast3d_close(cf5) == 0) {
- sprintf(buff, "Error closing output file %s ", ncurv);
- clean_fatal_error(buff);
+ clean();
+ G_fatal_error(_("Error closing output file %s"), ncurv);
} else
G_message(_("3D raster map <%s> created"), ncurv);
}
@@ -680,8 +693,8 @@
cf6 = Rast3d_open_new_opt_tile_size(gcurv, RASTER3D_USE_CACHE_DEFAULT, ¤t_region, FCELL_TYPE, 32);
if (cf6 == NULL) {
- sprintf(buff, "Can't open %s for writing ", gcurv);
- clean_fatal_error(buff);
+ clean();
+ G_fatal_error(_("Unable to open %s for writing"), gcurv);
}
/* seek to the beginning */
@@ -690,8 +703,10 @@
/* Read data in from temp file */
read_val =
fread(data, sizeof(float), nsizr * nsizc * nsizl, Tmp_fd_yy);
- if (read_val < 0)
- clean_fatal_error("Cannot read data from temp file");
+ if (read_val < 0) {
+ clean();
+ G_fatal_error(_("Unable to read data from temp file"));
+ }
cnt = 0;
for (iarc = 0; iarc < nsizl; iarc++) {
@@ -706,10 +721,10 @@
if (!bmask)
Rast3d_set_null_value(&value, 1, FCELL_TYPE);
if (Rast3d_put_float(cf6, x, y, iarc, value) == 0) {
- sprintf(buff,
- "Error writing cell (%d,%d,%d) with value %f",
+ clean();
+ G_fatal_error(
+ _("Error writing cell (%d,%d,%d) with value %f"),
x, y, iarc, value);
- clean_fatal_error(buff);
}
cnt++;
@@ -720,8 +735,8 @@
/* Close the file */
if (Rast3d_close(cf6) == 0) {
- sprintf(buff, "Error closing output file %s ", gcurv);
- clean_fatal_error(buff);
+ clean();
+ G_fatal_error(_("Error closing output file %s"), gcurv);
} else
G_message(_("3D raster map <%s> created"), gcurv);
}
@@ -731,8 +746,8 @@
cf7 = Rast3d_open_new_opt_tile_size(mcurv, RASTER3D_USE_CACHE_DEFAULT, ¤t_region, FCELL_TYPE, 32);
if (cf7 == NULL) {
- sprintf(buff, "Can't open %s for writing ", mcurv);
- clean_fatal_error(buff);
+ clean();
+ G_fatal_error(_("Unable to open %s for writing"), mcurv);
}
/* seek to the beginning */
@@ -741,8 +756,10 @@
/* Read data in from temp file */
read_val =
fread(data, sizeof(float), nsizr * nsizc * nsizl, Tmp_fd_xy);
- if (read_val < 0)
- clean_fatal_error("Cannot read data from temp file");
+ if (read_val < 0) {
+ clean();
+ G_fatal_error(_("Unable to read data from temp file"));
+ }
cnt = 0;
for (iarc = 0; iarc < nsizl; iarc++) {
@@ -757,10 +774,10 @@
if (!bmask)
Rast3d_set_null_value(&value, 1, FCELL_TYPE);
if (Rast3d_put_float(cf7, x, y, iarc, value) == 0) {
- sprintf(buff,
- "Error writing cell (%d,%d,%d) with value %f",
+ clean();
+ G_fatal_error(
+ _("Error writing cell (%d,%d,%d) with value %f"),
x, y, iarc, value);
- clean_fatal_error(buff);
}
cnt++;
@@ -771,8 +788,8 @@
/* Close the file */
if (Rast3d_close(cf7) == 0) {
- sprintf(buff, "Error closing output file %s ", mcurv);
- clean_fatal_error(buff);
+ clean();
+ G_fatal_error(_("Error closing output file %s"), mcurv);
} else
G_message(_("3D raster map <%s> created"), mcurv);
}
Modified: grass/branches/releasebranch_7_0/vector/v.vol.rst/user2.c
===================================================================
--- grass/branches/releasebranch_7_0/vector/v.vol.rst/user2.c 2015-01-12 12:25:46 UTC (rev 64081)
+++ grass/branches/releasebranch_7_0/vector/v.vol.rst/user2.c 2015-01-12 12:36:33 UTC (rev 64082)
@@ -30,6 +30,7 @@
#include <math.h>
#include <stdlib.h>
#include <grass/gis.h>
+#include <grass/glocale.h>
#include "oct.h"
#include "surf.h"
@@ -116,12 +117,14 @@
if (!
(points =
(struct quadruple *)G_malloc(sizeof(struct quadruple) *
- (KMAX2 + 1))))
- clean_fatal_error("Not enough memory for points");
+ (KMAX2 + 1)))) {
+ clean();
+ G_fatal_error(_("Not enough memory for %s"), "points");
+ }
}
/* if(!(point=(struct point_3d*)G_malloc(sizeof(struct point_3d)*(KMAX2+1))))
- clean_fatal_error("Not enough memory for points"); */
+ {clean(); G_fatal_error("Not enough memory for points");} */
distx = (((struct octdata *)(tree->data))->n_cols * ew_res) * 0.1;
@@ -206,23 +209,28 @@
(A =
(double *)G_malloc(sizeof(double) *
((KMAX2 + 1) * (KMAX2 + 2) + 1)))) {
- clean_fatal_error("Cannot allocate A");
+ clean();
+ G_fatal_error(_("Cannot allocate A"));
}
if (!(b = (double *)G_malloc(sizeof(double) * (KMAX2 + 2)))) {
- clean_fatal_error("Cannot allocate b");
+ clean();
+ G_fatal_error(_("Cannot allocate b"));
}
if (!(w = (double *)G_malloc(sizeof(double) * (KMAX2 + 1)))) {
- clean_fatal_error("Cannot allocate w");
+ clean();
+ G_fatal_error(_("Cannot allocate w"));
}
}
}
/* if(!(points=(struct quadruple*)G_malloc(sizeof(struct quadruple)*(npt))))
- clean_fatal_error("Not enough memory for points"); */
+ {clean(); G_fatal_error("Not enough memory for points");} */
if (!
(point =
- (struct point_3d *)G_malloc(sizeof(struct point_3d) * (npt))))
- clean_fatal_error("Not enough memory for points");
+ (struct point_3d *)G_malloc(sizeof(struct point_3d) * (npt)))) {
+ clean();
+ G_fatal_error(_("Not enough memory for %s"), "point");
+ }
/* cv stuff */
Modified: grass/branches/releasebranch_7_0/vector/v.vol.rst/user3.c
===================================================================
--- grass/branches/releasebranch_7_0/vector/v.vol.rst/user3.c 2015-01-12 12:25:46 UTC (rev 64081)
+++ grass/branches/releasebranch_7_0/vector/v.vol.rst/user3.c 2015-01-12 12:36:33 UTC (rev 64082)
@@ -35,6 +35,7 @@
#include <grass/raster.h>
#include <grass/vector.h>
#include <grass/dbmi.h>
+#include <grass/glocale.h>
#include "oct.h"
#include "surf.h"
@@ -267,16 +268,22 @@
stepiz = tb_res / dnorm;
if (!w2) {
- if (!(w2 = (double *)G_malloc(sizeof(double) * (KMAX2 + 1))))
- clean_fatal_error("Cannot allocate w2");
+ if (!(w2 = (double *)G_malloc(sizeof(double) * (KMAX2 + 1)))) {
+ clean();
+ G_fatal_error(_("Not enough memory for %s"), "w2");
+ }
}
if (!wz2) {
- if (!(wz2 = (double *)G_malloc(sizeof(double) * (KMAX2 + 1))))
- clean_fatal_error("Cannot allocate wz2");
+ if (!(wz2 = (double *)G_malloc(sizeof(double) * (KMAX2 + 1)))) {
+ clean();
+ G_fatal_error(_("Not enough memory for %s"), "wz2");
+ }
}
if (!wz1) {
- if (!(wz1 = (double *)G_malloc(sizeof(double) * (KMAX2 + 1))))
- clean_fatal_error("Cannot allocate wz1");
+ if (!(wz1 = (double *)G_malloc(sizeof(double) * (KMAX2 + 1)))) {
+ clean();
+ G_fatal_error(_("Not enough memory for %s"), "wz1");
+ }
}
if (cell == NULL)
@@ -535,8 +542,10 @@
(aspect2 != NULL)
|| (ncurv != NULL) || (gcurv != NULL) ||
(mcurv != NULL))
- if (!(secpar_loop(ngstc, nszc, l)))
- clean_fatal_error("Secpar_loop failed");
+ if (!(secpar_loop(ngstc, nszc, l))) {
+ clean();
+ G_fatal_error(_("Secpar_loop failed"));
+ }
if ((cellinp != NULL) && (cellout != NULL) &&
(i == ngstl)) {
zero_array_cell[l - 1] = (FCELL) (wwcell);
@@ -572,72 +581,88 @@
if (!
(fwrite
(zero_array_cell + ind1, sizeof(FCELL),
- nszc - ngstc + 1, Tmp_fd_cell)))
- clean_fatal_error
- ("Not enough disk space--cannot write files");
+ nszc - ngstc + 1, Tmp_fd_cell))) {
+ clean();
+ G_fatal_error
+ (_("Not enough disk space--cannot write files"));
+ }
}
if (outz != NULL) {
G_fseek(Tmp_fd_z, (off_t)(offset2 * sizeof(float)), 0);
if (!
(fwrite
(zero_array1 + ind1, sizeof(float), nszc - ngstc + 1,
- Tmp_fd_z)))
- clean_fatal_error
- ("Not enough disk space--cannot write files");
+ Tmp_fd_z))) {
+ clean();
+ G_fatal_error
+ (_("Not enough disk space--cannot write files"));
+ }
}
if (gradient != NULL) {
G_fseek(Tmp_fd_dx, (off_t)(offset2 * sizeof(float)), 0);
if (!
(fwrite
(zero_array2 + ind1, sizeof(float), nszc - ngstc + 1,
- Tmp_fd_dx)))
- clean_fatal_error
- ("Not enough disk space--cannot write files");
+ Tmp_fd_dx))) {
+ clean();
+ G_fatal_error
+ (_("Not enough disk space--cannot write files"));
+ }
}
if (aspect1 != NULL) {
G_fseek(Tmp_fd_dy, (off_t)(offset2 * sizeof(float)), 0);
if (!
(fwrite
(zero_array3 + ind1, sizeof(float), nszc - ngstc + 1,
- Tmp_fd_dy)))
- clean_fatal_error
- ("Not enough disk space--cannot write files");
+ Tmp_fd_dy))) {
+ clean();
+ G_fatal_error
+ (_("Not enough disk space--cannot write files"));
+ }
}
if (aspect2 != NULL) {
G_fseek(Tmp_fd_dz, (off_t)(offset2 * sizeof(float)), 0);
if (!
(fwrite
(zero_array4 + ind1, sizeof(float), nszc - ngstc + 1,
- Tmp_fd_dz)))
- clean_fatal_error
- ("Not enough disk space--cannot write files");
+ Tmp_fd_dz))) {
+ clean();
+ G_fatal_error
+ (_("Not enough disk space--cannot write files"));
+ }
}
if (ncurv != NULL) {
G_fseek(Tmp_fd_xx, (off_t)(offset2 * sizeof(float)), 0);
if (!
(fwrite
(zero_array5 + ind1, sizeof(float), nszc - ngstc + 1,
- Tmp_fd_xx)))
- clean_fatal_error
- ("Not enough disk space--cannot write files");
+ Tmp_fd_xx))) {
+ clean();
+ G_fatal_error
+ (_("Not enough disk space--cannot write files"));
+ }
}
if (gcurv != NULL) {
G_fseek(Tmp_fd_yy, (off_t)(offset2 * sizeof(float)), 0);
if (!
(fwrite
(zero_array6 + ind1, sizeof(float), nszc - ngstc + 1,
- Tmp_fd_yy)))
- clean_fatal_error
- ("Not enough disk space--cannot write files");
+ Tmp_fd_yy))) {
+ clean();
+ G_fatal_error
+ (_("Not enough disk space--cannot write files"));
+ }
}
if (mcurv != NULL) {
G_fseek(Tmp_fd_xy, (off_t)(offset2 * sizeof(float)), 0);
if (!
(fwrite
(zero_array7 + ind1, sizeof(float), nszc - ngstc + 1,
- Tmp_fd_xy)))
- clean_fatal_error
- ("Not enough disk space--cannot write files");
+ Tmp_fd_xy))) {
+ clean();
+ G_fatal_error
+ (_("Not enough disk space--cannot write files"));
+ }
}
}
Modified: grass/branches/releasebranch_7_0/vector/v.vol.rst/user4.c
===================================================================
--- grass/branches/releasebranch_7_0/vector/v.vol.rst/user4.c 2015-01-12 12:25:46 UTC (rev 64081)
+++ grass/branches/releasebranch_7_0/vector/v.vol.rst/user4.c 2015-01-12 12:36:33 UTC (rev 64082)
@@ -44,7 +44,7 @@
*/
-void clean_fatal_error(char *str)
+void clean()
{
if (Tmp_fd_z) {
fclose(Tmp_fd_z);
@@ -74,7 +74,6 @@
fclose(Tmp_fd_xy);
unlink(Tmp_file_xy);
}
- G_fatal_error(str);
}
Modified: grass/branches/releasebranch_7_0/vector/v.vol.rst/vector.c
===================================================================
--- grass/branches/releasebranch_7_0/vector/v.vol.rst/vector.c 2015-01-12 12:25:46 UTC (rev 64081)
+++ grass/branches/releasebranch_7_0/vector/v.vol.rst/vector.c 2015-01-12 12:36:33 UTC (rev 64082)
@@ -34,6 +34,7 @@
#include <grass/gis.h>
#include <grass/vector.h>
#include <grass/dbmi.h>
+#include <grass/glocale.h>
#include "oct.h"
#include "surf.h"
@@ -76,7 +77,7 @@
if (db_execute_immediate(driver, &sql) != DB_OK) {
db_close_database(driver);
db_shutdown_driver(driver);
- G_fatal_error("Cannot insert new row: %s", db_get_string(&sql));
+ G_fatal_error(_("Cannot insert new row: %s"), db_get_string(&sql));
}
count++;
More information about the grass-commit
mailing list