Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-gpu
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc-gpu
Commits
d663d29a
Commit
d663d29a
authored
Mar 06, 2010
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Also provide erand48 and jrand48, they come almost for free
parent
df9356f5
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
3 deletions
+21
-3
compat/nrand48.c
compat/nrand48.c
+19
-3
include/vlc_fixups.h
include/vlc_fixups.h
+2
-0
No files found.
compat/nrand48.c
View file @
d663d29a
/*****************************************************************************
* nrand48.c: POSIX
nrand48() replacement
* nrand48.c: POSIX
erand48(), jrand48() and nrand48() replacements
*****************************************************************************
* Copyright © 2010 Rémi Denis-Courmont
*
...
...
@@ -24,7 +24,7 @@
#include <inttypes.h>
long
nrand
48
(
unsigned
short
subi
[
3
])
static
uint64_t
iterate
48
(
unsigned
short
subi
[
3
])
{
const
uint64_t
a
=
UINT64_C
(
0x5DEECE66D
);
const
unsigned
c
=
13
;
...
...
@@ -42,5 +42,21 @@ long nrand48 (unsigned short subi[3])
subi
[
1
]
=
(
x
>>
16
)
&
0xFFFF
;
subi
[
2
]
=
(
x
>>
0
)
&
0XFFFF
;
return
x
>>
17
;
return
x
;
}
double
erand48
(
unsigned
short
subi
[
3
])
{
uint64_t
r
=
iterate48
(
subi
);
return
((
double
)
r
)
/
281474976710655
.;
}
long
jrand48
(
unsigned
short
subi
[
3
])
{
return
((
int64_t
)
iterate48
(
subi
))
>>
16
;
}
long
nrand48
(
unsigned
short
subi
[
3
])
{
return
iterate48
(
subi
)
>>
17
;
}
include/vlc_fixups.h
View file @
d663d29a
...
...
@@ -241,6 +241,8 @@ struct pollfd
/* Random numbers */
#ifndef HAVE_NRAND48
double
erand48
(
unsigned
short
subi
[
3
]);
long
jrand48
(
unsigned
short
subi
[
3
]);
long
nrand48
(
unsigned
short
subi
[
3
]);
#endif
...
...
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