Re: [GRASS-dev] [GRASS-SVN] r65249 - grass/trunk/raster/r.topidx

2015-05-15 Thread Vaclav Petras
Hi, I see that you are making the indent in a file consistent but I just
wanted to make sure you know that I recently updated the script
./tools/grass_indent.sh.

On Fri, May 15, 2015 at 11:42 AM, svn_gr...@osgeo.org wrote:

 Author: hcho
 Date: 2015-05-15 08:42:52 -0700 (Fri, 15 May 2015)
 New Revision: 65249

 Modified:
grass/trunk/raster/r.topidx/main.c
grass/trunk/raster/r.topidx/topidx.c
 Log:
 r.topidx: indent

 Modified: grass/trunk/raster/r.topidx/main.c
 ===
 --- grass/trunk/raster/r.topidx/main.c  2015-05-15 14:45:57 UTC (rev 65248)
 +++ grass/trunk/raster/r.topidx/main.c  2015-05-15 15:42:52 UTC (rev 65249)
 @@ -51,7 +51,7 @@
 exit(EXIT_FAILURE);

  /* Make sure that the current projection is not lat/long */
 -if ((G_projection() == PROJECTION_LL))
 +if (G_projection() == PROJECTION_LL)
 G_fatal_error(_(Lat/Long location is not supported by %s. Please
 reproject map first.),
   G_program_name());


 Modified: grass/trunk/raster/r.topidx/topidx.c
 ===
 --- grass/trunk/raster/r.topidx/topidx.c2015-05-15 14:45:57 UTC
 (rev 65248)
 +++ grass/trunk/raster/r.topidx/topidx.c2015-05-15 15:42:52 UTC
 (rev 65249)
 @@ -125,7 +125,8 @@
 sum += route[0];
 nroute++;
 }
 -   if (!is_cv_null(i - 1, j)  cv(i, j) - cv(i - 1, j) 
 ZERO) {
 +   if (!is_cv_null(i - 1, j) 
 +   cv(i, j) - cv(i - 1, j)  ZERO) {
 tanB[1] = (cv(i, j) - cv(i - 1, j)) * dx1;
 route[1] = 0.5 * dx * tanB[1];
 sum += route[1];
 @@ -148,7 +149,8 @@
 nroute++;
 }
 if (j + 1  window.cols) {
 -   if (!is_cv_null(i, j + 1)  cv(i, j) - cv(i, j + 1) 
 ZERO) {
 +   if (!is_cv_null(i, j + 1) 
 +   cv(i, j) - cv(i, j + 1)  ZERO) {
 tanB[5] = (cv(i, j) - cv(i, j + 1)) * dx1;
 route[5] = 0.5 * dx * tanB[5];
 sum += route[5];
 @@ -164,7 +166,8 @@
 sum += route[6];
 nroute++;
 }
 -   if (!is_cv_null(i + 1, j)  cv(i, j) - cv(i + 1, j) 
 ZERO) {
 +   if (!is_cv_null(i + 1, j) 
 +   cv(i, j) - cv(i + 1, j)  ZERO) {
 tanB[7] = (cv(i, j) - cv(i + 1, j)) * dx1;
 route[7] = 0.5 * dx * tanB[7];
 sum += route[7];
 @@ -187,46 +190,38 @@
 nslp = 0;
 if (i  0) {
 if (j  0  !is_cv_null(i - 1, j - 1)) {
 -   sumtb += (cv(i - 1, j - 1)
 - - cv(i, j)) * dx2;
 +   sumtb += (cv(i - 1, j - 1) - cv(i, j)) * dx2;
 nslp++;
 }
 if (!is_cv_null(i - 1, j)) {
 -   sumtb += (cv(i - 1, j)
 - - cv(i, j)) * dx1;
 +   sumtb += (cv(i - 1, j) - cv(i, j)) * dx1;
 nslp++;
 }
 if (j + 1  window.cols  !is_cv_null(i - 1, j +
 1)) {
 -   sumtb += (cv(i - 1, j + 1)
 - - cv(i, j)) * dx2;
 +   sumtb += (cv(i - 1, j + 1) - cv(i, j)) * dx2;
 nslp++;
 }
 }

 if (j  0  !is_cv_null(i, j - 1)) {
 -   sumtb += (cv(i, j - 1)
 - - cv(i, j)) * dx1;
 +   sumtb += (cv(i, j - 1) - cv(i, j)) * dx1;
 nslp++;
 }
 if (j + 1  window.cols  !is_cv_null(i, j + 1)) {
 -   sumtb += (cv(i, j + 1)
 - - cv(i, j)) * dx1;
 +   sumtb += (cv(i, j + 1) - cv(i, j)) * dx1;
 nslp++;
 }
 if (i + 1  window.rows) {
 if (j  0  !is_cv_null(i + 1, j - 1)) {
 -   sumtb += (cv(i + 1, j - 1)
 - - cv(i, j)) * dx2;
 +   sumtb += (cv(i + 1, j - 1) - cv(i, j)) * dx2;
 nslp++;
 }
 if (!is_cv_null(i + 1, j)) {
 -   sumtb += (cv(i + 1, j)
 - - cv(i, j)) * dx1;
 +   sumtb += (cv(i + 1, j) - cv(i, j)) * dx1;
   

Re: [GRASS-dev] [GRASS-SVN] r65249 - grass/trunk/raster/r.topidx

2015-05-15 Thread Vaclav Petras
On Fri, May 15, 2015 at 2:04 PM, Huidae Cho gras...@gmail.com wrote:

 Hi, Thanks for pointing me to the script. I just manually adjusted
several lines to make them 80 columns. Based on the script, it looks like
couple options were dropped (-ts8, -ut) and new ones were added (-npro,
--no-tabs).

-npro was there before. It prevents loading the user settings or something
like that.

For the rest, see the relevant change set:

https://trac.osgeo.org/grass/changeset/64658



 On Fri, May 15, 2015 at 1:22 PM, Vaclav Petras wenzesl...@gmail.com
wrote:

 Hi, I see that you are making the indent in a file consistent but I just
wanted to make sure you know that I recently updated the script
./tools/grass_indent.sh.

 On Fri, May 15, 2015 at 11:42 AM, svn_gr...@osgeo.org wrote:

 Author: hcho
 Date: 2015-05-15 08:42:52 -0700 (Fri, 15 May 2015)
 New Revision: 65249

 Modified:
grass/trunk/raster/r.topidx/main.c
grass/trunk/raster/r.topidx/topidx.c
 Log:
 r.topidx: indent



 ___
 grass-commit mailing list
 grass-com...@lists.osgeo.org
 http://lists.osgeo.org/mailman/listinfo/grass-commit



___
grass-dev mailing list
grass-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-dev

Re: [GRASS-dev] [GRASS-SVN] r65249 - grass/trunk/raster/r.topidx

2015-05-15 Thread Huidae Cho
Hi, Thanks for pointing me to the script. I just manually adjusted several
lines to make them 80 columns. Based on the script, it looks like couple
options were dropped (-ts8, -ut) and new ones were added (-npro, --no-tabs).



On Fri, May 15, 2015 at 1:22 PM, Vaclav Petras wenzesl...@gmail.com wrote:

 Hi, I see that you are making the indent in a file consistent but I just
 wanted to make sure you know that I recently updated the script
 ./tools/grass_indent.sh.

 On Fri, May 15, 2015 at 11:42 AM, svn_gr...@osgeo.org wrote:

 Author: hcho
 Date: 2015-05-15 08:42:52 -0700 (Fri, 15 May 2015)
 New Revision: 65249

 Modified:
grass/trunk/raster/r.topidx/main.c
grass/trunk/raster/r.topidx/topidx.c
 Log:
 r.topidx: indent

 Modified: grass/trunk/raster/r.topidx/main.c
 ===
 --- grass/trunk/raster/r.topidx/main.c  2015-05-15 14:45:57 UTC (rev
 65248)
 +++ grass/trunk/raster/r.topidx/main.c  2015-05-15 15:42:52 UTC (rev
 65249)
 @@ -51,7 +51,7 @@
 exit(EXIT_FAILURE);

  /* Make sure that the current projection is not lat/long */
 -if ((G_projection() == PROJECTION_LL))
 +if (G_projection() == PROJECTION_LL)
 G_fatal_error(_(Lat/Long location is not supported by %s. Please
 reproject map first.),
   G_program_name());


 Modified: grass/trunk/raster/r.topidx/topidx.c
 ===
 --- grass/trunk/raster/r.topidx/topidx.c2015-05-15 14:45:57 UTC
 (rev 65248)
 +++ grass/trunk/raster/r.topidx/topidx.c2015-05-15 15:42:52 UTC
 (rev 65249)
 @@ -125,7 +125,8 @@
 sum += route[0];
 nroute++;
 }
 -   if (!is_cv_null(i - 1, j)  cv(i, j) - cv(i - 1, j)
  ZERO) {
 +   if (!is_cv_null(i - 1, j) 
 +   cv(i, j) - cv(i - 1, j)  ZERO) {
 tanB[1] = (cv(i, j) - cv(i - 1, j)) * dx1;
 route[1] = 0.5 * dx * tanB[1];
 sum += route[1];
 @@ -148,7 +149,8 @@
 nroute++;
 }
 if (j + 1  window.cols) {
 -   if (!is_cv_null(i, j + 1)  cv(i, j) - cv(i, j + 1)
  ZERO) {
 +   if (!is_cv_null(i, j + 1) 
 +   cv(i, j) - cv(i, j + 1)  ZERO) {
 tanB[5] = (cv(i, j) - cv(i, j + 1)) * dx1;
 route[5] = 0.5 * dx * tanB[5];
 sum += route[5];
 @@ -164,7 +166,8 @@
 sum += route[6];
 nroute++;
 }
 -   if (!is_cv_null(i + 1, j)  cv(i, j) - cv(i + 1, j)
  ZERO) {
 +   if (!is_cv_null(i + 1, j) 
 +   cv(i, j) - cv(i + 1, j)  ZERO) {
 tanB[7] = (cv(i, j) - cv(i + 1, j)) * dx1;
 route[7] = 0.5 * dx * tanB[7];
 sum += route[7];
 @@ -187,46 +190,38 @@
 nslp = 0;
 if (i  0) {
 if (j  0  !is_cv_null(i - 1, j - 1)) {
 -   sumtb += (cv(i - 1, j - 1)
 - - cv(i, j)) * dx2;
 +   sumtb += (cv(i - 1, j - 1) - cv(i, j)) * dx2;
 nslp++;
 }
 if (!is_cv_null(i - 1, j)) {
 -   sumtb += (cv(i - 1, j)
 - - cv(i, j)) * dx1;
 +   sumtb += (cv(i - 1, j) - cv(i, j)) * dx1;
 nslp++;
 }
 if (j + 1  window.cols  !is_cv_null(i - 1, j +
 1)) {
 -   sumtb += (cv(i - 1, j + 1)
 - - cv(i, j)) * dx2;
 +   sumtb += (cv(i - 1, j + 1) - cv(i, j)) * dx2;
 nslp++;
 }
 }

 if (j  0  !is_cv_null(i, j - 1)) {
 -   sumtb += (cv(i, j - 1)
 - - cv(i, j)) * dx1;
 +   sumtb += (cv(i, j - 1) - cv(i, j)) * dx1;
 nslp++;
 }
 if (j + 1  window.cols  !is_cv_null(i, j + 1)) {
 -   sumtb += (cv(i, j + 1)
 - - cv(i, j)) * dx1;
 +   sumtb += (cv(i, j + 1) - cv(i, j)) * dx1;
 nslp++;
 }
 if (i + 1  window.rows) {
 if (j  0  !is_cv_null(i + 1, j - 1)) {
 -   sumtb += (cv(i + 1, j - 1)
 - - cv(i, j)) * dx2;
 +   sumtb += (cv(i + 1, j - 1) - cv(i, j)) * dx2;