POV-Ray : Newsgroups : povray.programming : Trivial bug in unix.cpp Server Time
5 Jul 2024 16:19:34 EDT (-0400)
  Trivial bug in unix.cpp (Message 11 to 16 of 16)  
<<< Previous 10 Messages Goto Initial 10 Messages
From: Christopher James Huff
Subject: Re: Trivial bug in unix.cpp
Date: 25 Nov 2003 18:02:27
Message: <cjameshuff-DA813A.18012225112003@netplex.aussie.org>
In article <3FC### [at] freefr>,
 Nicolas Calimet <pov### [at] freefr> wrote:

> > Sorry, but the presence of a flag is tested by using 
> >   state & flag 
> > and not
> >   state | flag
> > because the latter is always true. 
> 
> 	No. The latter is false when both state and flag are false.
> It's true in any other case.

Of what use would this be? And even then, it wouldn't work 
properly...such a flag could never be set, but state | flag would be 
true if any other flag is set.

-- 
Christopher James Huff <cja### [at] earthlinknet>
http://home.earthlink.net/~cjameshuff/
POV-Ray TAG: chr### [at] tagpovrayorg
http://tag.povray.org/


Post a reply to this message

From: Nicolas Calimet
Subject: Re: Trivial bug in unix.cpp
Date: 25 Nov 2003 18:16:43
Message: <3FC3E2DA.40801@free.fr>
>>>  state | flag
>>>because the latter is always true. 
>>
>>	No. The latter is false when both state and flag are false.
>>It's true in any other case.
>
> Of what use would this be?

	None.  I was simply noticing that the statement:
"state | flag  is always true" is not correct in the general
sense (i.e. as written here).

	- NC


Post a reply to this message

From: Wolfgang Wieser
Subject: Re: Trivial bug in unix.cpp
Date: 26 Nov 2003 11:54:03
Message: <3fc4daa6@news.povray.org>
Thorsten Froehlich wrote:
> In article <3fc3c9ad@news.povray.org> , Wolfgang Wieser wrote:
>> And -- if you read code like that:
>>     if(state | StateBit) { do sth }
>> What would you think about the author? -- Oh dear...
> 
> Compared to code used in some commercial applications, the code in POV-Ray
> is almost perfect. ;-)
> 
> Sadly, for any project that is big or complex enough you cannot say much
> about the authors if you just look at the code when it is 15 years old and
> has been treated by dozens of people.  Even if it would be a new project,
> at best you can say how good the project management was, but still very
> little about the authors.
> 
> Saying something about one particular author requires to make sure only
> one
> author ever touched the code.  If you are lucky you find such condition in
> an entry-level programming course, not anywhere else :-(
> 
You misunderstood me...

I just wanted to make a point stating that the above code should 
be fixed even "if it ain't broken"...

(For the same reson why people fix typos in a book even if you can read 
the book _with_ the typos.)

Wolfgang


Post a reply to this message

From: Wolfgang Wieser
Subject: Re: Trivial bug in unix.cpp
Date: 26 Nov 2003 12:17:41
Message: <3fc4e034@news.povray.org>
Christoph Hormann wrote:
> Please understand that also for a user interface bug the basic rules of
> bug reporting apply, i.e. clear description of the symptoms of the
> problem is required.  If you had said you tested that this change fixes
> a lack of response to ctrl-l in POV-Ray everything would have been clear.
> 
I completely understand you. 

Just to give you the background: 
The bug was _not_ discovered by observing misbehaviour. I just had 
a casual look at unix.cpp while writing my PRT patch and that 
particular line just jumped on me. It was so evident to me that this 
was a bug because from doing XLib programming for years, 
XEvent.state and ControlMask were familiar to me and so I thought 
any deeper explanation would just bore the maintainer...

Wolfgang


Post a reply to this message

From: Wolfgang Wieser
Subject: Re: Trivial bug in unix.cpp
Date: 26 Nov 2003 12:18:43
Message: <3fc4e072@news.povray.org>
Nicolas Calimet wrote:
> Anyway, thanx for fiding this.  The Xwindows code would
> actually need more extensive review, so if you find any other
> problem which is not related to Xwindows-specific command-line
> options (this part of the code is quite buggy; currently fixed),
> you're welcome to report !
> 
Okay, that's no problem -- If I find a bug and have a fix, I always 
report it. In case I don't have a fix, I report only severe bugs. 
It would, however, be helpful if you gave me the current development 
version of POVRay. 

Wolfgang


Post a reply to this message

From: Nicolas Calimet
Subject: Re: Trivial bug in unix.cpp
Date: 27 Nov 2003 03:22:36
Message: <3FC5B44C.6010201@free.fr>
> It would, however, be helpful if you gave me the current development 
> version of POVRay. 

	Apart the obvious bugfixes in XWIN_init_povray() that I mentioned
before, the current Xwindows-specific code is still the same as in 3.50c,
so reviewing the latter would be for sure of a great help.

	- NC


Post a reply to this message

<<< Previous 10 Messages Goto Initial 10 Messages

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.