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

Huidae Cho grass4u at gmail.com
Fri May 15 11:04:54 PDT 2015


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 <wenzeslaus at 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_grass at 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.c        2015-05-15 14:45:57 UTC
>> (rev 65248)
>> +++ grass/trunk/raster/r.topidx/topidx.c        2015-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;
>>                             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++;
>>                         }
>>                     }
>>
>> _______________________________________________
>> grass-commit mailing list
>> grass-commit at lists.osgeo.org
>> http://lists.osgeo.org/mailman/listinfo/grass-commit
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/grass-dev/attachments/20150515/af6c7c79/attachment-0001.html>


More information about the grass-dev mailing list