[GRASS5] An error in v.surf.idw main program --- may be a bug.

Glynn Clements glynn at gclements.plus.com
Fri Dec 30 17:25:04 EST 2005


Muzaffer Ayvaz wrote:

>   While i am compiling the grass source codes gcc shows a warning. for the line
>    
>   .....
>     /* interpolate */
>   sum1 = 0.0;
>   sum2 = 0.0;
>   for (n = 0; n < nsearch; n++)
>   {
>   if(dist = list[n].dist)
>   {
>   
> 
>    
>   The code is like that in both 6.0.1 version and 6.0.2RC1.
>   is it an error or anythig else.

No, it's correct, but could be written better as:

	dist = list[n].dist;
	if (dist)
		...
or:
	if(dist = list[n].dist, dist)


> i think it must be;
>    
>     if ( dist == list[n].dist)

No, the assignment must be performed.

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




More information about the grass-dev mailing list