Commit 61e0fcce authored by Ken Thompson's avatar Ken Thompson

small bug

new printarray

R=r
OCL=21429
CL=21429
parent 697cb17b
...@@ -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·printpointer(ret); sys·printarray(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·printpointer(old); sys·printarray(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·printpointer(ret); sys·printarray(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·printpointer(ret); sys·printarray(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·printpointer(ret); sys·printarray(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);
}
...@@ -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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment