Commit 535dcf77 authored by Russ Cox's avatar Russ Cox

minor tweaks

R=r
DELTA=9  (2 added, 5 deleted, 2 changed)
OCL=24107
CL=24152
parent e73acc1b
...@@ -155,7 +155,7 @@ itype(Sigi *si, Sigt *st, int32 canfail) ...@@ -155,7 +155,7 @@ itype(Sigi *si, Sigt *st, int32 canfail)
} }
} }
} }
ni = si[0].perm; // first entry has size ni = si[0].perm; // first entry has size
m = mal(sizeof(*m) + ni*sizeof(m->fun[0])); m = mal(sizeof(*m) + ni*sizeof(m->fun[0]));
m->sigi = si; m->sigi = si;
...@@ -178,13 +178,8 @@ throw: ...@@ -178,13 +178,8 @@ throw:
sname = st[nt].name; sname = st[nt].name;
if(sname == nil) { if(sname == nil) {
if(!canfail) { if(!canfail) {
prints("cannot convert type "); printf("cannot convert type %s to interface %s: missing method %s\n",
prints((int8*)st[0].name); st[0].name, si[0].name, iname);
prints(" to interface ");
prints((int8*)si[0].name);
prints(": missing method ");
prints((int8*)iname);
prints("\n");
if(iface_debug) { if(iface_debug) {
prints("interface"); prints("interface");
printsigi(si); printsigi(si);
...@@ -429,7 +424,7 @@ uint64 ...@@ -429,7 +424,7 @@ uint64
ifacehash(Iface a) ifacehash(Iface a)
{ {
int32 alg, wid; int32 alg, wid;
if(a.type == nil) if(a.type == nil)
return 0; return 0;
alg = a.type->sigt->hash & 0xFF; alg = a.type->sigt->hash & 0xFF;
...@@ -591,7 +586,7 @@ fakesigt(string type, bool indir) ...@@ -591,7 +586,7 @@ fakesigt(string type, bool indir)
h = h*37 + type->str[i]; h = h*37 + type->str[i];
h += indir; h += indir;
h %= nelem(fake); h %= nelem(fake);
for(locked=0; locked<2; locked++) { for(locked=0; locked<2; locked++) {
if(locked) if(locked)
lock(&ifacelock); lock(&ifacelock);
...@@ -647,7 +642,7 @@ static Sigt* ...@@ -647,7 +642,7 @@ static Sigt*
findtype(string type, bool indir) findtype(string type, bool indir)
{ {
int32 i, lo, hi, m; int32 i, lo, hi, m;
lo = 0; lo = 0;
hi = ngotypesigs; hi = ngotypesigs;
while(lo < hi) { while(lo < hi) {
......
...@@ -12,6 +12,8 @@ findnull(byte *s) ...@@ -12,6 +12,8 @@ findnull(byte *s)
{ {
int32 l; int32 l;
if(s == nil)
return 0;
for(l=0; s[l]!=0; l++) for(l=0; s[l]!=0; l++)
; ;
return l; return l;
......
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