Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
purr-data
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Pranay Gupta
purr-data
Commits
832d5d7c
Commit
832d5d7c
authored
Aug 03, 2018
by
Pranay Gupta
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
double precision changes to the freeverb~ external class
parent
9eb7691c
Pipeline
#1373
canceled with stage
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
38 additions
and
15 deletions
+38
-15
freeverb~.c
externals/freeverb~/freeverb~.c
+38
-15
No files found.
externals/freeverb~/freeverb~.c
View file @
832d5d7c
...
...
@@ -143,28 +143,51 @@ typedef struct _freeverb
//#define FIX_DENORM_NAN_FLOAT(v);
//#endif
typedef
union
ulf
{
unsigned
long
ul
;
float
f
;
}
ulf
;
#if defined(__i386__) || defined(__x86_64__) // Type punning code:
static
inline
float
fix_denorm_nan_float
(
float
v
);
#if PD_FLOATSIZE == 32
static
inline
float
fix_denorm_nan_float
(
float
v
)
typedef
union
{
#ifndef IRIX
ulf
u
;
t_float
f
;
uint32_t
ui
;
}
ulf
;
u
.
f
=
v
;
if
((((
u
.
ul
&
0x7f800000
)
==
0L
)
&&
(
u
.
f
!=
0
.
f
))
||
((
u
.
ul
&
0x7f800000
)
==
0x7f800000
))
/* Test strictly for NANs and infs */
static
inline
t_float
fix_denorm_nan_float
(
t_float
f
)
{
ulf
pun
;
pun
.
f
=
f
;
if
((((
pun
.
ui
&
0x7f800000
)
==
0L
)
&&
(
pun
.
f
!=
0
.
f
))
||
((
pun
.
ui
&
0x7f800000
)
==
0x7f800000
))
/* if the float is denormal or NaN, return 0.0 */
v
=
0
.
0
f
;
//return 0.0f;
#endif //IRIX
return
v
;
f
=
0
.
0
f
;
return
f
;
}
#elif PD_FLOATSIZE == 64
typedef
union
{
t_float
f
;
uint32_t
ui
[
2
];
}
ulf
;
/* Test for NANs and infs */
static
inline
int
fix_denorm_nan_float
(
t_float
f
)
{
ulf
pun
;
pun
.
f
=
f
;
if
((((
pun
.
ui
[
1
]
&
0x7ff00000
)
==
0L
)
&&
(
u
.
f
!=
0
.
f
))
||
((
pun
.
ui
[
1
]
&
0x7ff00000
)
==
0x7ff00000
))
/* if the float is denormal or NaN, return 0.0 */
f
=
0
.
0
f
return
f
;
}
#endif // endif PD_FLOATSIZE
#else // if not defined(__i386__) || defined(__x86_64__)
#define fix_denorm_nan_float(f) 0
#endif // end if defined(__i386__) || defined(__x86_64__)
/* we need prototypes for Mac for everything */
static
void
comb_setdamp
(
t_freeverb
*
x
,
t_floatarg
val
);
static
void
comb_setfeedback
(
t_freeverb
*
x
,
t_floatarg
val
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment