[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[gnugo-devel] rotate(i, j, &i, &j, ...)

From: Teun Burgers
Subject: [gnugo-devel] rotate(i, j, &i, &j, ...)
Date: Mon, 15 Oct 2001 18:38:26 +0200

Gunnar Farneback wrote:

> The patch still looks buggy to me. Have you tested that you get the
> same results as with explicit reorientation of the tests?
> The problem I see is that rotate() is sometimes called for in place
> transformation of vertices like this:
> rotate(i, j, &i, &j, ...)
> but in rotate() we have e.g.
>   } else if (rot == 3) {
>     /* rotation over 270 degrees */
>     *ri = j;
>     *rj = bs1 - i;
> It seems to me like the assignment of *ri on one line may corrupt the
> contents of i used on the next line.

No. The way C passes arguments, i and j in rotate are copies of
the values in the calling routine. So *ri modifies the value
in the calling routine, not the local one.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]