[GRASS-dev] d.linegraph indentation mess

Hi,

by chance I saw come compiler warning:

make[1]: Entering directory '/home/neteler/software/grass73/display/d.linegraph'
gcc -g -Wall -Wshadow -Wlogical-op
-Werror-implicit-function-declaration -fPIC -fno-common -fexceptions
-Wextra -Wunused -Wreturn-type -Wfatal-errors -march=native -std=gnu99
-fexceptions -fstack-protector -m64 -fdiagnostics-color
-I/home/neteler/software/grass73/dist.x86_64-pc-linux-gnu/include
-I/home/neteler/software/grass73/dist.x86_64-pc-linux-gnu/include
-DPACKAGE=\""grassmods"\"
-I/home/neteler/software/grass73/dist.x86_64-pc-linux-gnu/include
-I/home/neteler/software/grass73/dist.x86_64-pc-linux-gnu/include
-DRELDIR=\"display/d.linegraph\" -o OBJ.x86_64-pc-linux-gnu/main.o -c
main.c
main.c: In function ‘main’:
main.c:396:16: warning: comparison between signed and unsigned integer
expressions [-Wsign-compare]
  for (j = 0; j < strlen(title[i]->answer); j++)
                ^
main.c:526:16: warning: comparison between signed and unsigned integer
expressions [-Wsign-compare]
  for (i = 0; i <= (strlen(y_color_opt->answer)); i++) {
                ^~
main.c:528:6: warning: comparison between signed and unsigned integer
expressions [-Wsign-compare]
   (i == (strlen(y_color_opt->answer)))) {
      ^~
main.c:735:5: warning: this ‘if’ clause does not guard...
[-Wmisleading-indentation]
     if (scale_x_values)
     ^~
main.c:739:2: note: ...this statement, but the latter is misleadingly
indented as if it is guarded by the ‘if’
  if ((err != 1) || (err == EOF)) {
  ^~

Indeed, the if() statement in 735 has some issues: braces missing or
indentation wrong.

Any idea how to fix that correctly?

Markus

On Sat, Dec 17, 2016 at 7:15 AM, Markus Neteler <neteler@osgeo.org> wrote:

Indeed, the if() statement in 735 has some issues: braces missing or
indentation wrong.

Any idea how to fix that correctly?

I need to look at these two if more closely, but otherwise I think I'll
just reindent all and do the classic int -> size_t replacements.

On Sun, Dec 18, 2016 at 4:29 PM, Vaclav Petras <wenzeslaus@gmail.com> wrote:

I'll just reindent all

Done. It was just the indent.

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

and do the classic int -> size_t replacements.

Not done. A lot of code would be to be changed including tr strings.
Leaving that for some other round of changes.