[GRASS-dev] [bug #5025] (grass) v.hull: empty if statement

this bug's URL: http://intevation.de/rt/webrt?serial_num=5025
-------------------------------------------------------------------------

Subject: v.hull: empty if statement

grass obtained from: CVS
grass binary for platform: Compiled from Sources

Hi,

compiling v.hull, I discovered:

[neteler@dandre v.hull]$ make
...
main.c: In function ‘loadSiteCoordinates’:
main.c:141: warning: empty body in an if-statement

            if ((pointIdx % ALLOC_CHUNK) == 0);
               *points = (struct Point *) G_realloc(*points, (pointIdx + ALLOC_CHUNK) * sizeof(struct Point));

I don't know how to fix this.

Markus

-------------------------------------------- Managed by Request Tracker

Request Tracker wrote:

this bug's URL: http://intevation.de/rt/webrt?serial_num=5025
-------------------------------------------------------------------------

Subject: v.hull: empty if statement

grass obtained from: CVS
grass binary for platform: Compiled from Sources

Hi,

compiling v.hull, I discovered:

[neteler@dandre v.hull]$ make
...
main.c: In function ‘loadSiteCoordinates’:
main.c:141: warning: empty body in an if-statement

            if ((pointIdx % ALLOC_CHUNK) == 0);
               *points = (struct Point *) G_realloc(*points, (pointIdx + ALLOC_CHUNK) * sizeof(struct Point));

I don't know how to fix this.

Remove the semicolon; the above will be parsed as:

  if ((pointIdx % ALLOC_CHUNK) == 0)
    ;
  *points = (struct Point *) G_realloc(*points, (pointIdx + ALLOC_CHUNK) * sizeof(struct Point));

A semicolon on its own is a valid statement which does nothing, hence
the "empty body" warning.

I've fixed this in CVS.

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