Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
G
golang
Project
Project
Details
Activity
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
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
go
golang
Commits
963753d3
Commit
963753d3
authored
Jul 20, 2008
by
Ken Thompson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tweaks to init
rand using init SVN=128142
parent
f24f8ffa
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
10 deletions
+12
-10
dcl.c
src/cmd/gc/dcl.c
+12
-10
rand.go
src/lib/rand.go
+0
-0
No files found.
src/cmd/gc/dcl.c
View file @
963753d3
...
...
@@ -917,7 +917,7 @@ void
fninit
(
Node
*
n
)
{
Node
*
done
,
*
any
;
Node
*
a
,
*
b
,
*
r
;
Node
*
a
,
*
fn
,
*
r
;
Iter
iter
;
ulong
h
;
Sym
*
s
;
...
...
@@ -941,10 +941,10 @@ fninit(Node *n)
if
(
strcmp
(
package
,
"main"
)
==
0
)
snprint
(
namebuf
,
sizeof
(
namebuf
),
"init_function"
);
b
=
nod
(
ODCLFUNC
,
N
,
N
);
b
->
nname
=
newname
(
lookup
(
namebuf
));
b
->
type
=
functype
(
N
,
N
,
N
);
funchdr
(
b
);
fn
=
nod
(
ODCLFUNC
,
N
,
N
);
fn
->
nname
=
newname
(
lookup
(
namebuf
));
fn
->
type
=
functype
(
N
,
N
,
N
);
funchdr
(
fn
);
// (3)
a
=
nod
(
OIF
,
N
,
N
);
...
...
@@ -968,6 +968,7 @@ fninit(Node *n)
if
(
s
->
oname
==
N
)
continue
;
// could check that it is fn of no args/returns
a
=
nod
(
OCALL
,
s
->
oname
,
N
);
r
=
list
(
r
,
a
);
}
...
...
@@ -976,6 +977,7 @@ fninit(Node *n)
r
=
list
(
r
,
n
);
// (7)
// could check that it is fn of no args/returns
snprint
(
namebuf
,
sizeof
(
namebuf
),
"init_%s"
,
filename
);
s
=
lookup
(
namebuf
);
if
(
s
->
oname
!=
N
)
{
...
...
@@ -989,13 +991,13 @@ fninit(Node *n)
// (9)
a
=
nod
(
OEXPORT
,
N
,
N
);
a
->
sym
=
b
->
nname
->
sym
;
a
->
sym
=
fn
->
nname
->
sym
;
markexport
(
a
);
b
->
nbody
=
rev
(
r
);
//dump("b",
b
);
//dump("r",
b
->nbody);
fn
->
nbody
=
rev
(
r
);
//dump("b",
fn
);
//dump("r",
fn
->nbody);
popdcl
();
compile
(
b
);
compile
(
fn
);
}
src/lib/rand.go
0 → 100644
View file @
963753d3
This diff is collapsed.
Click to expand it.
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