Cockos : REAPER : NINJAM : Forums
Forum Home : Register : FAQ : Members List : Search :
Old 03-26-2011, 03:46 PM   #1
Human being with feelings
Tale's Avatar
Join Date: Jul 2008
Location: The Netherlands
Posts: 2,936
Default Typo/bug in denormal.h

I happened to spy these two lines in denormal.h:

#define WDL_DENORMAL_DOUBLE_HW(a) (((const WDL_DenormalDoubleAccess*)(a))->w.hw)
#define WDL_DENORMAL_DOUBLE_LW(a) (((const WDL_DenormalDoubleAccess*)(a))->w.hw)
Obviously the second line should read:

#define WDL_DENORMAL_DOUBLE_LW(a) (((const WDL_DenormalDoubleAccess*)(a))->w.lw)
There is another set of almost identical lines with the same problem.

Fortunately this doesn't affect the denormal code, because it only uses the high word, but it does cause GetDoubleMaxAbsValue() to not work as intended.

I have fixed this (see my Git repository). I have also added a couple of macros and moved some existing code into them, so one can now use WDL_DENORMAL_OR_ZERO_DOUBLE(&a) from a plug-in to test if a value could be a denormal. (If anyone would like to cherry pick this fix/update: You will need to cherry pick two seperate commits, because I didn't get it right the first time. Sorry!)
Tale is offline   Reply With Quote

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

All times are GMT -7. The time now is 12:59 PM.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2019, vBulletin Solutions Inc.