Re: [Fractdev] 2 probs w the 20.99.8 Fractint 4 Windows

Top Page
Delete this message
Reply to this message
Author: Richard
Date:  
To: Fractint developer's list
Subject: Re: [Fractdev] 2 probs w the 20.99.8 Fractint 4 Windows

In article <MDBBJLBFBICIIEIHFBMEOEBGDGAA.hallane@???>,
"Hal Lane" <hallane@???> writes:

> [...] I have never understood
> why C and C++ wanted to encourage the size of an int to be variable
> with the processor the application ran on.


C is considered more of a "low level" systems programming language,
while fortran was considered more of an application programming
language. In the end, C was used for lots of applications. There are
portable ways to deal with the potentially varying size of an int, but
unfortunately the code in fractint wasn't written portably. For
instance, you use sizeof(int) to advance a pointer through memory past
an integer instead of adding 2. Adding 2 works when integers are
16-bits (typical of a DOS C compiler), but not when integers are
32-bits (typical of a Win32 C compiler). So they could have written
their code to be less fragile with respect to things like "how big is
an int?" but they didn't.

> This has caused untold hours of lost time and productivity and
> calculation errors when processors and compilers went from 8 bits to
> 16 bits, then 16 to 32 and is still doing this when porting apps from
> 32 to 64 bits -- the very problems you are dealing with in the
> conversion of 16 bit DOS Fractint to 32 bit Windows Fractint.


Well, I'm not aware of any C compilers with 8-bit ints, even when the
processor was 8-bit, but I see your point.

> I really am tempted to look for the digit "2" in the code of the
> parser, but I really don't have the time to do it right now.


The 2 vs. sizeof(int) is only my current theory on what's wrong with
the parser. It doesn't happen on *all* formulas, which makes it more
problematic to debug. Plus the parser code is rather inscrutable. It
would probably be faster for me to rewrite the parser than find this
bug and fix it. There's just lots of stuff in there that it does that
isn't documented or explained.
-- 
"The Direct3D Graphics Pipeline" -- DirectX 9 draft available for download
      <http://www.xmission.com/~legalize/book/download/index.html>


Legalize Adulthood! <http://blogs.xmission.com/legalize/>