Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
R
relibc
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Peter Limkilde Svendsen
relibc
Commits
cc5a4e92
Commit
cc5a4e92
authored
7 years ago
by
Paul Sajna
Browse files
Options
Downloads
Patches
Plain Diff
fmt
parent
a24f537a
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/stdlib/src/lib.rs
+3
-7
3 additions, 7 deletions
src/stdlib/src/lib.rs
with
3 additions
and
7 deletions
src/stdlib/src/lib.rs
+
3
−
7
View file @
cc5a4e92
...
...
@@ -2,9 +2,7 @@
#![feature(core_intrinsics)]
#![feature(global_allocator)]
///! stdlib implementation for Redox, following http://pubs.opengroup.org/onlinepubs/7908799/xsh/stdlib.h.html
extern
crate
ctype
;
extern
crate
errno
;
extern
crate
platform
;
...
...
@@ -12,7 +10,7 @@ extern crate ralloc;
extern
crate
rand
;
use
core
::{
ptr
,
str
};
use
rand
::{
Rng
,
XorShiftRng
,
Seedable
Rng
};
use
rand
::{
Rng
,
SeedableRng
,
XorShift
Rng
};
use
errno
::
*
;
use
platform
::
types
::
*
;
...
...
@@ -382,15 +380,13 @@ pub extern "C" fn qsort(
#[no_mangle]
pub
unsafe
extern
"C"
fn
rand
()
->
c_int
{
match
RNG
{
Some
(
ref
mut
rng
)
=>
{
rng
.gen_range
::
<
c_int
>
(
0
,
RAND_MAX
)
},
Some
(
ref
mut
rng
)
=>
rng
.gen_range
::
<
c_int
>
(
0
,
RAND_MAX
),
None
=>
{
let
mut
rng
=
XorShiftRng
::
from_seed
([
1
;
16
]);
let
ret
=
rng
.gen_range
::
<
c_int
>
(
0
,
RAND_MAX
);
RNG
=
Some
(
rng
);
ret
}
,
}
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment