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
61e0fcce
Commit
61e0fcce
authored
Dec 17, 2008
by
Ken Thompson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
small bug
new printarray R=r OCL=21429 CL=21429
parent
697cb17b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
11 deletions
+21
-11
array.c
src/runtime/array.c
+20
-11
runtime.h
src/runtime/runtime.h
+1
-0
No files found.
src/runtime/array.c
View file @
61e0fcce
...
@@ -23,7 +23,7 @@ sys·newarray(uint32 nel, uint32 cap, uint32 width, Array* ret)
...
@@ -23,7 +23,7 @@ sys·newarray(uint32 nel, uint32 cap, uint32 width, Array* ret)
d
->
array
=
d
->
b
;
d
->
array
=
d
->
b
;
ret
=
d
;
ret
=
d
;
FLUSH
(
&
d
);
FLUSH
(
&
ret
);
if
(
debug
)
{
if
(
debug
)
{
prints
(
"newarray: nel="
);
prints
(
"newarray: nel="
);
...
@@ -33,7 +33,7 @@ sys·newarray(uint32 nel, uint32 cap, uint32 width, Array* ret)
...
@@ -33,7 +33,7 @@ sys·newarray(uint32 nel, uint32 cap, uint32 width, Array* ret)
prints
(
"; width="
);
prints
(
"; width="
);
sys
·
printint
(
width
);
sys
·
printint
(
width
);
prints
(
"; ret="
);
prints
(
"; ret="
);
sys
·
print
pointer
(
ret
);
sys
·
print
array
(
ret
);
prints
(
"
\n
"
);
prints
(
"
\n
"
);
}
}
}
}
...
@@ -85,11 +85,11 @@ sys·arraysliced(Array* old, uint32 lb, uint32 hb, uint32 width, Array* ret)
...
@@ -85,11 +85,11 @@ sys·arraysliced(Array* old, uint32 lb, uint32 hb, uint32 width, Array* ret)
d
->
array
=
old
->
array
+
lb
*
width
;
d
->
array
=
old
->
array
+
lb
*
width
;
ret
=
d
;
ret
=
d
;
FLUSH
(
&
d
);
FLUSH
(
&
ret
);
if
(
debug
)
{
if
(
debug
)
{
prints
(
"sys·arrayslices: old="
);
prints
(
"sys·arrayslices: old="
);
sys
·
print
pointer
(
old
);
sys
·
print
array
(
old
);
prints
(
"; lb="
);
prints
(
"; lb="
);
sys
·
printint
(
lb
);
sys
·
printint
(
lb
);
prints
(
"; hb="
);
prints
(
"; hb="
);
...
@@ -97,7 +97,7 @@ sys·arraysliced(Array* old, uint32 lb, uint32 hb, uint32 width, Array* ret)
...
@@ -97,7 +97,7 @@ sys·arraysliced(Array* old, uint32 lb, uint32 hb, uint32 width, Array* ret)
prints
(
"; width="
);
prints
(
"; width="
);
sys
·
printint
(
width
);
sys
·
printint
(
width
);
prints
(
"; ret="
);
prints
(
"; ret="
);
sys
·
print
pointer
(
ret
);
sys
·
print
array
(
ret
);
prints
(
"
\n
"
);
prints
(
"
\n
"
);
}
}
}
}
...
@@ -132,7 +132,7 @@ sys·arrayslices(byte* old, uint32 nel, uint32 lb, uint32 hb, uint32 width, Arra
...
@@ -132,7 +132,7 @@ sys·arrayslices(byte* old, uint32 nel, uint32 lb, uint32 hb, uint32 width, Arra
d
->
array
=
old
+
lb
*
width
;
d
->
array
=
old
+
lb
*
width
;
ret
=
d
;
ret
=
d
;
FLUSH
(
&
d
);
FLUSH
(
&
ret
);
if
(
debug
)
{
if
(
debug
)
{
prints
(
"sys·arrayslices: old="
);
prints
(
"sys·arrayslices: old="
);
...
@@ -146,7 +146,7 @@ sys·arrayslices(byte* old, uint32 nel, uint32 lb, uint32 hb, uint32 width, Arra
...
@@ -146,7 +146,7 @@ sys·arrayslices(byte* old, uint32 nel, uint32 lb, uint32 hb, uint32 width, Arra
prints
(
"; width="
);
prints
(
"; width="
);
sys
·
printint
(
width
);
sys
·
printint
(
width
);
prints
(
"; ret="
);
prints
(
"; ret="
);
sys
·
print
pointer
(
ret
);
sys
·
print
array
(
ret
);
prints
(
"
\n
"
);
prints
(
"
\n
"
);
}
}
}
}
...
@@ -164,15 +164,24 @@ sys·arrays2d(byte* old, uint32 nel, Array* ret)
...
@@ -164,15 +164,24 @@ sys·arrays2d(byte* old, uint32 nel, Array* ret)
d
->
array
=
old
;
d
->
array
=
old
;
ret
=
d
;
ret
=
d
;
FLUSH
(
&
d
);
FLUSH
(
&
ret
);
if
(
debug
)
{
if
(
debug
)
{
prints
(
"sys·arrays2d: old="
);
prints
(
"sys·arrays2d: old="
);
sys
·
printpointer
(
old
);
sys
·
printpointer
(
old
);
prints
(
"; nel="
);
sys
·
printint
(
nel
);
prints
(
"; ret="
);
prints
(
"; ret="
);
sys
·
print
pointer
(
ret
);
sys
·
print
array
(
ret
);
prints
(
"
\n
"
);
prints
(
"
\n
"
);
}
}
}
}
void
sys
·
printarray
(
Array
*
a
)
{
prints
(
"["
);
sys
·
printint
(
a
->
nel
);
prints
(
","
);
sys
·
printint
(
a
->
cap
);
prints
(
"]"
);
sys
·
printpointer
(
a
->
array
);
}
src/runtime/runtime.h
View file @
61e0fcce
...
@@ -348,6 +348,7 @@ void sys·printpc(void*);
...
@@ -348,6 +348,7 @@ void sys·printpc(void*);
void
sys
·
printpointer
(
void
*
);
void
sys
·
printpointer
(
void
*
);
void
sys
·
printuint
(
uint64
);
void
sys
·
printuint
(
uint64
);
void
sys
·
printhex
(
uint64
);
void
sys
·
printhex
(
uint64
);
void
sys
·
printarray
(
Array
*
);
void
sys
·
catstring
(
string
,
string
,
string
);
void
sys
·
catstring
(
string
,
string
,
string
);
void
sys
·
cmpstring
(
string
,
string
,
int32
);
void
sys
·
cmpstring
(
string
,
string
,
int32
);
void
sys
·
slicestring
(
string
,
int32
,
int32
,
string
);
void
sys
·
slicestring
(
string
,
int32
,
int32
,
string
);
...
...
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