[GRASS-dev] [GRASS-SVN] r60669 - grass/trunk/vector/v.vol.rst

Glynn Clements glynn at gclements.plus.com
Mon Jun 2 22:41:15 PDT 2014


Markus Neteler wrote:

> if I may make a suggestion on the message translation:
> 
> On Mon, Jun 2, 2014 at 4:14 PM,  <svn_grass at osgeo.org> wrote:
> > Author: hcho
> > Date: 2014-06-02 07:14:16 -0700 (Mon, 02 Jun 2014)
> > New Revision: 60669
> >
> > Modified:
> >    grass/trunk/vector/v.vol.rst/dataoct.c
> >    grass/trunk/vector/v.vol.rst/main.c
> >    grass/trunk/vector/v.vol.rst/user1.c
> >    grass/trunk/vector/v.vol.rst/user2.c
> >    grass/trunk/vector/v.vol.rst/user3.c
> >    grass/trunk/vector/v.vol.rst/vector.c
> > Log:
> > v.vol.rst: translate error/warning messages
> 
> All these messages need now to be translated separately (translator "hell" :):
> 
> > -       G_fatal_error("Not enough memory for az");
> > +       G_fatal_error(_("Not enough memory for 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 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 ady"));
> >      adxx = (double *)G_malloc(sizeof(double) * (n_cols + 1));
> >      if (!adxx)
> [...]

Actually, there's no point in those messages even existing. G_malloc()
cannot return a null pointer, as it calls G_fatal_error() itself if
the underlying malloc() fails.

This has been the case since at least 4.2.1 (the oldest version I have
here).

Also: it should probably be using Rast_allocate_d_buf() (or
Rast_allocate_d_{input,output}_buf() if it's using a split window).

-- 
Glynn Clements <glynn at gclements.plus.com>


More information about the grass-dev mailing list