A little question about GDSaveGamma()

Hello,

I was taking a look at some of the toolbox sources today. I am curious
about a detail in GDSaveGamma(). The size of the allocated handle is
calculated as:

gamma->gChanCnt * gamma->gDataCnt (*2 if gamma->gDataWidth>8) +
sizeof(GammaTbl) + gamma->gFormulaSize

Isn't this calculation 2 bytes too large? If you look at the definition
of the struct GammaTbl, its last member is:
short gFormulaData[1];

So, sizeof(GammaTbl) already includes 2 bytes of the formula or gamma
data; and the allocated handle could be 2 bytes shorter than the above calculation.

This observation (if correct) in no way qualifies as a bug. I just
mention it because I'm curious to know if I'm missing something...

-Peter


--

Peter April
VPixx Technologies Inc.
Phone: 450-922-1635
Fax: 450-922-5173
Email: peter@...
Web: http://www.vpixx.com
>Hello,
>
>I was taking a look at some of the toolbox sources today. I am curious
>about a detail in GDSaveGamma(). The size of the allocated handle is
>calculated as:
>
> gamma->gChanCnt * gamma->gDataCnt (*2 if gamma->gDataWidth>8) +
>sizeof(GammaTbl) + gamma->gFormulaSize
>
>Isn't this calculation 2 bytes too large? If you look at the definition
>of the struct GammaTbl, its last member is:
> short gFormulaData[1];
>
>So, sizeof(GammaTbl) already includes 2 bytes of the formula or gamma
>data; and the allocated handle could be 2 bytes shorter than the
>above calculation.
>
>This observation (if correct) in no way qualifies as a bug. I just
>mention it because I'm curious to know if I'm missing something...
>
> -Peter
>
>
>--
>
>Peter April
>VPixx Technologies Inc.
>Phone: 450-922-1635
>Fax: 450-922-5173
>Email: peter@...
>Web: http://www.vpixx.com


dear peter

yes, you're right. i hadn't noticed that. as you note, it was
harmless in that instance, but it appeared in several other places as
well, so i fixed it throughout.

thanks

best

denis