[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.
Teun
- [gnugo-devel] Reorientation, Teun Burgers, 2001/10/10
- [gnugo-devel] Re: Reorientation, Teun Burgers, 2001/10/10
- Re: [gnugo-devel] Re: Reorientation, Gunnar Farneback, 2001/10/14
- [gnugo-devel] rotate(i, j, &i, &j, ...),
Teun Burgers <=
- Re: [gnugo-devel] rotate(i, j, &i, &j, ...), Gunnar Farneback, 2001/10/15
- Re: [gnugo-devel] Reorientation, Daniel Bump, 2001/10/10
- Re: [gnugo-devel] Reorientation, Daniel Bump, 2001/10/10
- Re: [gnugo-devel] Reorientation, Gunnar Farneback, 2001/10/10